title: Convert each attribute of a node into its sibling node
body: <p>I have an XML file with data in this format</p>
  <pre><code>&lt;export&gt;
    &lt;timestamp itst=&quot;1478582248&quot;&gt;2016-11-08T05:17:28Z&lt;/timestamp&gt;
  &lt;/export&gt;
  </code></pre>
  <p>I would like to convert each attribute of a node into its sibling node.</p>
  <p>I tried this:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  
  &lt;xsl:stylesheet version=&quot;1.0&quot;
                  xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt;
      
      &lt;xsl:output method=&quot;xml&quot; indent=&quot;yes&quot; /&gt;   
      
      &lt;xsl:template match=&quot;/&quot;&gt;
          &lt;xsl:apply-templates select=&quot;@*|node()&quot;/&gt;
      &lt;/xsl:template&gt;
      
      &lt;xsl:template match=&quot;@*|node()&quot;&gt;
          &lt;xsl:copy&gt;
              &lt;xsl:apply-templates select=&quot;@*|node()&quot;/&gt;
          &lt;/xsl:copy&gt;
      &lt;/xsl:template&gt;
      
      &lt;xsl:template match=&quot;@*&quot;&gt;
          &lt;xsl:element name=&quot;{name()}&quot;&gt;&lt;xsl:value-of select=&quot;.&quot;/&gt;&lt;/xsl:element&gt;
      &lt;/xsl:template&gt;
      
      
      
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  <p>This is creating a nested or a child node instead of a sibling node.</p>
  <pre><code>&lt;timestamp&gt;
    &lt;itst&gt;1478582248&lt;/itst&gt;2016-11-08T05:17:28Z&lt;/timestamp&gt;
  </code></pre>
  <p>Expected output</p>
  <pre><code>&lt;timestamp&gt;2016-11-08T05:17:28Z&lt;/timestamp&gt;
  &lt;itst&gt;1478582248&lt;/itst&gt;
  
  </code></pre>