title: split a large xml using xslt 1.0
body: <p>I have to a large xml in the below format.</p>
  
  <pre><code>&lt;First&gt;
  &lt;Second Argument="12" Argument2="34" &gt;
      &lt;Order InvOrg="123" Identifier="3580456" &gt;
                  &lt;SupplyDetails Type="TRACK" Quantity="7" Demand="ONHAND" /&gt;
      &lt;/Order&gt;
      &lt;Order InvOrg="Test" Identifier="3580457" &gt;
                  &lt;SupplyDetails Type="TRACK" Quantity="15" Demand="ONHAND" /&gt;
      &lt;/Order&gt;
      &lt;Order InvOrg="123" Identifier="3580458" &gt;
                  &lt;SupplyDetails Type="TRACK" Quantity="17" Demand="ONHAND" /&gt;
      &lt;/Order&gt;
      &lt;Order InvOrg="123" Identifier="3580459" &gt;
                  &lt;SupplyDetails Type="TRACK" Quantity="10" Demand="ONHAND" /&gt;
      &lt;/Order&gt;
      &lt;Order InvOrg="123" Identifier="2888144" &gt;
                  &lt;SupplyDetails Type="TRACK" Quantity="3" Demand="ONHAND" /&gt;
      &lt;/Order&gt;
      &lt;Order InvOrg="123" Identifier="2888147" &gt;
                  &lt;SupplyDetails Type="TRACK" Quantity="9" Demand="ONHAND" /&gt;
      &lt;Order&gt;
      &lt;Order InvOrg="123" Identifier="2749622" &gt;
                  &lt;SupplyDetails Type="TRACK" Quantity="142" Demand="ONHAND" /&gt;
      &lt;/Order&gt;
  &lt;/Second&gt;
  &lt;/First&gt;
  </code></pre>
  
  <p>I need to convert it into the below format</p>
  
  <pre><code>&lt;First&gt;
  &lt;Second Argument="12" Argument2="34" &gt;
      &lt;Order InvOrg="123" Identifier="3580456" &gt;
                  &lt;SupplyDetails Type="TRACK" Quantity="7" Demand="ONHAND" /&gt;
      &lt;/Order&gt;
      &lt;Order InvOrg="Test" Identifier="3580457" &gt;
                  &lt;SupplyDetails Type="TRACK" Quantity="15" Demand="ONHAND" /&gt;
      &lt;/Order&gt;
      &lt;Order InvOrg="123" Identifier="3580458" &gt;
                  &lt;SupplyDetails Type="TRACK" Quantity="17" Demand="ONHAND" /&gt;
      &lt;/Order&gt;
  &lt;/Second&gt;
  &lt;/First&gt;
  &lt;First&gt;
  &lt;Second Argument="12" Argument2="34" &gt;
      &lt;Order InvOrg="123" Identifier="3580459" &gt;
                  &lt;SupplyDetails Type="TRACK" Quantity="10" Demand="ONHAND" /&gt;
      &lt;/Order&gt;
      &lt;Order InvOrg="123" Identifier="2888144" &gt;
                  &lt;SupplyDetails Type="TRACK" Quantity="3" Demand="ONHAND" /&gt;
      &lt;/Order&gt;
      &lt;Order InvOrg="123" Identifier="2888147" &gt;
                  &lt;SupplyDetails Type="TRACK" Quantity="9" Demand="ONHAND" /&gt;
      &lt;Order&gt;
      &lt;Order InvOrg="123" Identifier="2749622" &gt;
                  &lt;SupplyDetails Type="TRACK" Quantity="142" Demand="ONHAND" /&gt;
      &lt;/Order&gt;
  &lt;/Second&gt;
  &lt;/First&gt;
  </code></pre>
  
  <p>In xslt 2.0, It can be achieved with the below code..</p>
  
  <pre><code>&lt;xsl:stylesheet 
    version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  
  
  &lt;xsl:output method="xml" indent="yes"/&gt;
  
  &lt;xsl:template match="/First"&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/xsl:template&gt;
  
  &lt;xsl:template match="Second"&gt;
    &lt;xsl:for-each-group select="Order" group-starting-with="Order[(position() -1)mod 3 = 0]"&gt;
  
      &lt;First&gt;
         &lt;Second&gt;
            &lt;xsl:copy-of select="current-group()"/&gt;
         &lt;/Second&gt;
      &lt;/First&gt;
  
    &lt;/xsl:for-each-group&gt;
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p>My project uses only xslt 1.0, so i need to change the above logic to 1.0. How can i implement the same logic in xslt 1.0</p>