title: Xslt to copy inner xml without unused namespaces
body: <p>I wish to remove a couple of unused namespaces from a resulting output from an xslt stylesheet.</p>
  
  <p>The xml to feed in is a wrapper around another xml message which is seen in the <strong>BodyMessage</strong> element. An example of the entire xml can bee seen below: </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;ns0:Wrapper xmlns:ns0="http://ref.fairyliquidplc.ads/Schema/Fairy/Wrapper/1.0" xmlns:mco="http://ref.fairyliquidplc.ads/Schema/Fairy/Common/1.0"&gt;
    &lt;TaskName&gt;SomeTaskName&lt;/TaskName&gt;
    &lt;TaskStatus&gt;Start&lt;/TaskStatus&gt;
    &lt;Id&gt;Y/0070/0010&lt;/Id&gt;
    &lt;BodyMessage&gt;
      &lt;tva:TVAMain rightsOwner="FAIRY" xmlns:tva="urn:tva:metadata:2004"&gt;
          &lt;tva:Colour&gt;red&lt;/tva:Colour&gt;
          &lt;tva:Size&gt;12&lt;/tva:Size&gt;
          &lt;tva:Style&gt;Skinny&lt;/tva:Style&gt;
          &lt;tva:Fabric&gt;Denim&lt;/tva:Fabric&gt;
        &lt;/tva:TVAMain&gt;
    &lt;/BodyMessage&gt;
  &lt;/ns0:Wrapper&gt;
  </code></pre>
  
  <p>When I try to extract the xml out of the <strong>BodyMessage</strong> element I get unused namespaces returned </p>
  
  <pre><code>xmlns:ns0="http://ref.fairyliquidplc.ads/Schema/Fairy/Wrapper/1.0"
  xmlns:mco="http://ref.fairyliquidplc.ads/Schema/Fairy/Common/1.0"  
  </code></pre>
  
  <p>These are not required but I do not understand how to remove them within my xslt.  </p>
  
  <p>Please note I <strong>DO</strong> want to keep</p>
  
  <pre><code>xmlns:tva="urn:tva:metadata:2004"
  </code></pre>
  
  <p>The stylesheet I used is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:tva="urn:tva:metadata:2004"
  xmlns:msxsl="urn:schemas-microsoft-com:xslt"
  xmlns="http://www.w3.org/1999/xhtml"&gt;
  
  &lt;xsl:output encoding="UTF-8" method="xml" omit-xml-declaration="no" version="1.0" /&gt;
  
  &lt;xsl:template match="/"&gt;
  
      &lt;xsl:variable name="completeTva" select="//tva:TVAMain" /&gt;
      &lt;xsl:copy-of select ="$completeTva"/&gt;
  
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p></p>
  
  <p>The output of the stylesheet is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;tva:TVAMain rightsOwner="FAIRY" xmlns:tva="urn:tva:metadata:2004" xmlns:ns0="http://ref.fairyliquidplc.ads/Schema/Fairy/Wrapper/1.0" xmlns:mco="http://ref.fairyliquidplc.ads/Schema/Fairy/Common/1.0"&gt;
  &lt;tva:Colour&gt;red&lt;/tva:Colour&gt;
  &lt;tva:Size&gt;12&lt;/tva:Size&gt;
  &lt;tva:Style&gt;Skinny&lt;/tva:Style&gt;
  &lt;tva:Fabric&gt;Denim&lt;/tva:Fabric&gt;
  </code></pre>
  
  <p></p>
  
  <p>What I require is: </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;tva:TVAMain rightsOwner="FAIRY" xmlns:tva="urn:tva:metadata:2004"&gt;
  &lt;tva:Colour&gt;red&lt;/tva:Colour&gt;
  &lt;tva:Size&gt;12&lt;/tva:Size&gt;
  &lt;tva:Style&gt;Skinny&lt;/tva:Style&gt;
  &lt;tva:Fabric&gt;Denim&lt;/tva:Fabric&gt;
  </code></pre>
  
  <p></p>
  
  <p>Any help would be greatly appreciated.
  :)</p>