BizTalk 2013 Orchestration fails with Error "The Stylesheet is too Complex"

I recently came across an issue in which, after doing an upgrade from BizTalk 2010 to BizTalk 2013, BizTalk mapper functionality broke and started to get the following error: 

Error Message:
xlang/s engine event log entry: Uncaught exception (see the 'inner exception' below) has suspended an instance of service ‘ABC’
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.

Inner exception: Error encountered while executing the transform <MapName>. Error:Unable to create the transform..

Exception type: XTransformationFailureException
Source: Microsoft.XLANGs.Engine
Target Site: Void ApplyTransform(System.Type, System.Object[], System.Object[])

The following is a stack trace that identifies the location where the exception occurred
   at
Microsoft.XLANGs.Core.Context.ExceptionRaised()
  at
MSVL.Orchestrations.ProcessMSShippingSchedule.segment5(StopConditions stopOn)  
   at
Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)  

Additional error information:
         The stylesheet is too complex.  

Exception type: XsltException
Source: System.Data.SqlXml
Target Site: Void Check(System.Xml.Xsl.Qil.QilNode, Int32)

The following is a stack trace that identifies the location where the exception occurred
   at
System.Xml.Xsl.Qil.QilDepthChecker.Check(QilNode input, Int32 depth)  

The issue happens as after upgrading BizTalk to 2013, the .NET framework version changes from 4.0 to 4.5. There is a known issue with framework 4.5 as mentioned in the given article:
https://support.microsoft.com/kb/2828841/en-us

Symptom 4.
In order to get past this error, you needed to apply the hotfix and add the following to the Biztalk config file to enable the fix – Please note that the given information goes under respective nodes in BizTalk config file.

<configuration>
<configSections>
    <sectionGroup name="system.xml">
     <section name="xslt" type="System.Xml.XmlConfiguration.XsltConfigSection, System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
    </sectionGroup>
</configSections>
<system.xml>
    <xslt limitXPathComplexity="false"/>
</system.xml>
</configuration>

Once you make the above changes and restart the host instance, the issue should not occur anymore.

Hope this helps !!

Written By
Rasika Chaudhary

Reviewed By
Jainath Ramanathan

Microsoft GTSC