title: XSLT to remove some attributes
body: <p>I have the following XML which can appear in either form in my XML Document:</p>
  
  <p><code>&lt;Message xsi:schemaLocation="http://www.location.com StructureFile.xsd" xmlns=http://www.thenamespace.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;</code></p>
  
  <p>or</p>
  
  <p><code>&lt;Message xmlns="http://www.thenamespace.com"&gt;</code></p>
  
  <p>and I need the output to be:</p>
  
  <p><code>&lt;Message xmlns="http://www.theNEWnamespace.com"&gt;</code></p>
  
  <p>I currently have this template to handle the shorter version of the two xml possibilities:</p>
  
  <pre><code>&lt;xsl:template match="*"&gt;
    &lt;xsl:element name="{name()}" namespace="http://www.theNEWnamespace.com"&gt;
      &lt;xsl:copy-of select="@*"/&gt;
      &lt;xsl:apply-templates/&gt;
    &lt;/xsl:element&gt;
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p>However this does not remove the SchemeLocation or xmlns:xsi parts of the xml if they are in existance.</p>
  
  <p>How would I go about adapting the above to handle both possibilities.</p>
  
  <p>Cheers,</p>
  
  <p>Edit: XML structure:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Message xsi:schemaLocation="http://www.location.com StructureFile.xsd" xmlns="http://www.thenamespace.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
    &lt;Header&gt;
      &lt;Info&gt;&lt;/Info&gt;
    &lt;/Header&gt;
  &lt;/Message&gt;
  </code></pre>