title: Add xmlns to root element preserve existing namespaces
body: <p>I have the following XML:</p>
  <pre><code>&lt;RootNode xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:cac=&quot;http://b/2&quot; xmlns:cbc=&quot;http://a/2&quot; xmlns:ns0=&quot;SomeNamespace&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
     &lt;cbc:Element1&gt;0000000001234567&lt;/cbc:Element1&gt;
     &lt;cbc:Element2&gt;xxxxx&lt;/cbc:Element1&gt;
     &lt;cac:Element3&gt;
        &lt;cac:Element4&gt;
           &lt;cac:Element5&gt;
              &lt;cbc:Element6 schemeID=&quot;AAA&quot;&gt;1234567890123&lt;/cbc:Element6&gt;
           &lt;/cac:Element5&gt;
        &lt;/cac:Element4&gt;
     &lt;/cac:Element3&gt;
  &lt;/RootNode&gt;
  </code></pre>
  <p>And I want to add a xmlns attribute to the root node preserving all other namespaces.
  I have a XSLT to add the namespace, but it removes all namespaces and add only the xmlns.</p>
  <p><strong>With this XSLT:</strong></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 omit-xml-declaration=&quot;no&quot; indent=&quot;yes&quot;/&gt;
      &lt;xsl:strip-space elements=&quot;*&quot;/&gt;
  
      &lt;xsl:variable name=&quot;vDefaultNS&quot; select=&quot;'addedNamespace&quot;/&gt;
      
      &lt;!-- Extra --&gt;
      &lt;xsl:template match=&quot;*&quot;&gt;
          &lt;xsl:element name=&quot;{local-name()}&quot; namespace=&quot;{$vDefaultNS}&quot;&gt;
          &lt;xsl:copy-of select=&quot;@*&quot;/&gt;
              &lt;xsl:apply-templates/&gt;
          &lt;/xsl:element&gt;
      &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  <p><strong>I get:</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;RootNode xmlns=&quot;addedNamespace&quot;&gt;
     &lt;cbc:Element1&gt;0000000001234567&lt;/cbc:Element1&gt;
     &lt;cbc:Element2&gt;xxxxx&lt;/cbc:Element1&gt;
     &lt;cac:Element3&gt;
        &lt;cac:Element4&gt;
           &lt;cac:Element5&gt;
              &lt;cbc:Element6 schemeID=&quot;AAA&quot;&gt;1234567890123&lt;/cbc:Element6&gt;
           &lt;/cac:Element5&gt;
        &lt;/cac:Element4&gt;
     &lt;/cac:Element3&gt;
  &lt;/RootNode&gt;
  </code></pre>
  <p><strong>But I want:</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;RootNode xmlns=&quot;addedNamespace&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:cac=&quot;http://b/2&quot; xmlns:cbc=&quot;http://a/2&quot; xmlns:ns0=&quot;SomeNamespace&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
     &lt;cbc:Element1&gt;0000000001234567&lt;/cbc:Element1&gt;
     &lt;cbc:Element2&gt;xxxxx&lt;/cbc:Element1&gt;
     &lt;cac:Element3&gt;
        &lt;cac:Element4&gt;
           &lt;cac:Element5&gt;
              &lt;cbc:Element6 schemeID=&quot;AAA&quot;&gt;1234567890123&lt;/cbc:Element6&gt;
           &lt;/cac:Element5&gt;
        &lt;/cac:Element4&gt;
     &lt;/cac:Element3&gt;
  &lt;/RootNode&gt;
  </code></pre>