title: Insert XML element using XSLT in exisiting node
body: <p>I have the following XML document:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;root someAttribute="someValue" /&gt;
  </code></pre>
  
  <p>Now I want to add a tag using XSLT, so that the document will look like this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;root someAttribute="someValue"&gt;
    &lt;item&gt;TEXT&lt;/item&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>If I repeat to use the XSLT once more it should just add another item:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;root someAttribute="someValue"&gt;
    &lt;item&gt;TEXT&lt;/item&gt;
    &lt;item&gt;TEXT&lt;/item&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>It sound's so easy, does it not? Here is the best I got after trying a ton of things:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" &gt;
      &lt;xsl:param name="message" /&gt;
  
      &lt;xsl:output method="xml" encoding="utf-8"/&gt;
  
          &lt;xsl:template match="/*"&gt;
          &lt;xsl:copy&gt;
              &lt;xsl:copy-of select="*"/&gt;
              &lt;item&gt;
                  &lt;xsl:value-of select="$message" /&gt;
              &lt;/item&gt;
          &lt;/xsl:copy&gt;
      &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>It does /nearly/ what I have asked for, except that it "forgets" the attributes of the root element. I have found a number of other solutions here on stackoverflow and elsewhere that have in common with my solution that they loose the attributes of the root element. How can I fix that?</p>