title: How do I add a namespace to all elements in a node?
body: <p>Suppose I have some xml:</p>
  
  <pre><code>&lt;a&gt;
    &lt;b&gt;something&lt;/b&gt;
    &lt;c&gt;something&lt;/c&gt;
    &lt;d&gt;something&lt;/d&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>and I want all children of <code>&lt;a&gt;</code> to be prefixed with the <code>x</code> namespace. Currently I have the following to achieve this:</p>
  
  <pre><code>&lt;xsl:template match="a"&gt;
    &lt;a&gt;
      &lt;xsl:apply-templates&gt;
    &lt;/a&gt;
  &lt;/xsl:template&gt;
  
  &lt;xsl:template match="b"&gt;
    &lt;x:b&gt;&lt;xsl:value-of select="." /&gt;&lt;/x:b&gt;
  &lt;/xsl:template&gt;
  
  &lt;xsl:template match="c"&gt;
    &lt;x:c&gt;&lt;xsl:value-of select="." /&gt;&lt;/x:c&gt;
  &lt;/xsl:template&gt;
  
  &lt;xsl:template match="d"&gt;
    &lt;x:d&gt;&lt;xsl:value-of select="." /&gt;&lt;/x:d&gt;
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p>This works, but it is cumbersome and I have to know what all the children's names are. I am aware of the <code>match="*"</code> syntax but I don't know how to get the name of whatever <code>*</code> is so I can preface the <code>x</code> in the template match. Any ideas?</p>
  
  <p>To be clear, I am hoping to replace those <code>xsl:template</code> nodes with a single node that will prefix whatever node name with one containing the <code>x</code> namespace.</p>