title: XSLT reordering XML tags during standard copy
body: <p>I am using the following to copy XSLT content as is. But this is re-ordering the xml tags. Is this a bug in Microsoft's XSLT transformation. I am doing this from C#. Copied both C# code and xsl file content below</p>
  
  <p>C# code:</p>
  
  <pre><code>XPathDocument doc = new XPathDocument(new StringReader(data));
  XslTransform xsltransform = new XslTransform();
  //Load the stylesheet.
  xsltransform.Load(xslFile);
  
  // transform
  using (StringWriter sw = new StringWriter())
  {
      xsltransform.Transform(doc, null, sw);
  
      // save to string
      outputText = sw.ToString();
  }
  </code></pre>
  
  <p>xsl content:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"&gt;  
  &lt;xsl:template match="Root"&gt;
    &lt;Root&gt;
      &lt;xsl:apply-templates/&gt;
    &lt;/Root&gt;
  &lt;/xsl:template&gt;
  &lt;xsl:template match="@*|node()"&gt;
    &lt;xsl:copy&gt;
      &lt;xsl:apply-templates select="@*|node()"/&gt;
    &lt;/xsl:copy&gt;
  &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>From:</p>
  
  <pre><code>&lt;Root&gt;
  &lt;one&gt;
    &lt;one-1&gt;
      &lt;one-2&gt;
      &lt;/one-2&gt;
    &lt;/one-1&gt;
  &lt;/one&gt;
  &lt;two&gt;
    &lt;two-1&gt;
      &lt;two-2&gt;
      &lt;/two-2&gt;
    &lt;/two-1&gt;
  &lt;/two&gt;
  &lt;/Root&gt;
  </code></pre>
  
  <p>To:</p>
  
  <pre><code>&lt;Root&gt;
  &lt;one&gt;
   &lt;two&gt;
    &lt;two-1&gt;
      &lt;two-2&gt;
      &lt;/two-2&gt;
    &lt;/two-1&gt;
   &lt;/two&gt;      
  &lt;/one&gt;
  &lt;one-1&gt;
    &lt;one-2&gt;
    &lt;/one-2&gt;
  &lt;/one-1&gt;
  &lt;/Root&gt;
  </code></pre>