title: XSLT - converting value to a tag name, and grouping together
body: <p>I'm not sure if its possible, but I would like to transform the following using XSLT</p>
  
  <p>Source</p>
  
  <pre class="lang-xml prettyprint-override"><code>  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;Root&gt;
         &lt;MATNR&gt;3006921&lt;/MATNR&gt;
         &lt;MAKTX&gt;VANSH,DE,GOLD G.WHITE 6x900ML&lt;/MAKTX&gt;
         &lt;VKORG&gt;AT03&lt;/VKORG&gt;
         &lt;VKORG&gt;CH05&lt;/VKORG&gt;
         &lt;VKORG&gt;DE14&lt;/VKORG&gt;
         &lt;PMATN&gt;
            &lt;AttributeName&gt;AT03&lt;/AttributeName&gt;
            &lt;AttributeValue&gt;AT-GU4&lt;/AttributeValue&gt;
         &lt;/PMATN&gt;
         &lt;PMATN&gt;
            &lt;AttributeName&gt;CH05&lt;/AttributeName&gt;
            &lt;AttributeValue&gt;CH-I2Z&lt;/AttributeValue&gt;
         &lt;/PMATN&gt;
         &lt;PMATN&gt;
            &lt;AttributeName&gt;DE14&lt;/AttributeName&gt;
            &lt;AttributeValue&gt;DE-B6K&lt;/AttributeValue&gt;
         &lt;/PMATN&gt;
         &lt;DWERK&gt;
            &lt;AttributeName&gt;AT03&lt;/AttributeName&gt;
            &lt;AttributeValue&gt;AT-GU4&lt;/AttributeValue&gt;
         &lt;/DWERK&gt;
         &lt;DWERK&gt;
            &lt;AttributeName&gt;CH05&lt;/AttributeName&gt;
            &lt;AttributeValue&gt;CH-I2Z&lt;/AttributeValue&gt;
         &lt;/DWERK&gt;
         &lt;DWERK&gt;
            &lt;AttributeName&gt;DE14&lt;/AttributeName&gt;
            &lt;AttributeValue&gt;DE-B6K&lt;/AttributeValue&gt;
         &lt;/DWERK&gt;
         &lt;EAN11&gt;
            &lt;AttributeName&gt;CAR&lt;/AttributeName&gt;
            &lt;AttributeValue&gt;04002448087588&lt;/AttributeValue&gt;
         &lt;/EAN11&gt;
         &lt;EAN11&gt;
            &lt;AttributeName&gt;EA&lt;/AttributeName&gt;
            &lt;AttributeValue&gt;4002448077619&lt;/AttributeValue&gt;
         &lt;/EAN11&gt;
         &lt;VOLUME&gt;
            &lt;AttributeName&gt;CAR&lt;/AttributeName&gt;
            &lt;AttributeValue&gt;17460.432&lt;/AttributeValue&gt;
         &lt;/VOLUME&gt;
         &lt;VOLUME&gt;
            &lt;AttributeName&gt;EA&lt;/AttributeName&gt;
            &lt;AttributeValue&gt;2450.448&lt;/AttributeValue&gt;
         &lt;/VOLUME&gt;
         &lt;VOLUME&gt;
            &lt;AttributeName&gt;UN&lt;/AttributeName&gt;
            &lt;AttributeValue&gt;2450.448&lt;/AttributeValue&gt;
         &lt;/VOLUME&gt;
         &lt;VOLUME&gt;
            &lt;AttributeName&gt;ZST&lt;/AttributeName&gt;
            &lt;AttributeValue&gt;0&lt;/AttributeValue&gt;
         &lt;/VOLUME&gt;
      &lt;/Root&gt;
  </code></pre>
  
  <p>Result
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Root&gt;
     &lt;MATNR&gt;3006921&lt;/MATNR&gt;
     &lt;MAKTX&gt;VANSH,DE,GOLD G.WHITE 6x900ML&lt;/MAKTX&gt;
     &lt;VKORG&gt;AT03&lt;/VKORG&gt;
     &lt;VKORG&gt;CH05&lt;/VKORG&gt;
     &lt;VKORG&gt;DE14&lt;/VKORG&gt;
     &lt;PMATN&gt;
        &lt;AT03&gt;AT-GU4&lt;/AT03&gt;
        &lt;CH05&gt;CH-I2Z&lt;/CH05&gt;
        &lt;DE14&gt;DE-B6K&lt;/DE14&gt;
        &lt;DE14&gt;DE-B6K&lt;/DE14&gt;
     &lt;/PMATN&gt;
     &lt;DWERK&gt;
        &lt;AT03&gt;AT-GU4&lt;/AT03&gt;
        &lt;CH05&gt;CH-I2Z&lt;/CH05&gt;
        &lt;DE14&gt;DE-B6K&lt;/DE14&gt;
        &lt;DE14&gt;DE-B6K&lt;/DE14&gt;
     &lt;/DWERK&gt;
     &lt;EAN11&gt;
        &lt;CAR&gt;04002448087588&lt;/CAR&gt;
        &lt;EA&gt;4002448077619&lt;/EA&gt;
     &lt;/EAN11&gt;
     &lt;VOLUME&gt;
        &lt;CAR&gt;17460.432&lt;/CAR&gt;
        &lt;EA&gt;2450.448&lt;/EA&gt;
        &lt;UN&gt;2450.448&lt;/UN&gt;
        &lt;ZST&gt;0&lt;/ZST&gt;
     &lt;/VOLUME&gt;
  &lt;/Root&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>So for PMATN, DWERK, EAN11, VOLUME I would like the AttributeName value to become the tag name, with the value taken from the related AttributeValue. All grouped under a common pair of tags.</p>