title: XSLT blank xmlns="" after transform
body: <p>I'm using an XSLT to transform from one XML standard to another.  The particular resulting XML standard contains a root element which is part of a namespace and a child node which is part of another namepsace.</p>
  
  <p>The transform successfully reflects these namespaces but the child's child now contains a blank xmlns attribute.  How can I prevent this <code>xmlns=""</code>?</p>
  
  <p>XSLT Snippet:</p>
  
  <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
  &gt;
  
    &lt;xsl:output method="xml" indent="yes"/&gt;
  
    &lt;xsl:template match="@* | node()"&gt;
      &lt;xsl:apply-templates select="REQUEST_GROUP" /&gt;
    &lt;/xsl:template&gt;
  
    &lt;xsl:template match="REQUEST_GROUP"&gt;
      &lt;ONCORE_ERECORD xmlns="http://test.com"&gt;
        &lt;xsl:apply-templates select="REQUEST/PRIA_REQUEST/PACKAGE"/&gt;
        &lt;PAYMENT PaymentType="ACH" /&gt;
       &lt;TRANSACTION_INFO _AgentKey="" _AgentPassword="" /&gt;
      &lt;/ONCORE_ERECORD&gt;
   &lt;/xsl:template&gt;
  
    &lt;xsl:template match="PACKAGE"&gt;
      &lt;DOCUMENT_RECORDATION xmlns="http://test2.org"&gt;
          &lt;xsl:apply-templates select="PRIA_DOCUMENT"/&gt;
      &lt;/DOCUMENT_RECORDATION&gt;
    &lt;/xsl:template&gt;
  
    &lt;xsl:template match="PRIA_DOCUMENT"&gt;
      &lt;PRIA_DOCUMENT _PRIAVersion="1.2"&gt;
        &lt;xsl:attribute name="_Type"&gt;
          &lt;xsl:value-of select="@RecordableDocumentType"/&gt;
        &lt;/xsl:attribute&gt;
        &lt;xsl:attribute name="_Code"/&gt;
  
    &lt;xsl:apply-templates select="GRANTOR" /&gt;
    &lt;xsl:apply-templates select="GRANTEE" /&gt;
    &lt;xsl:choose&gt;
      &lt;xsl:when test="count(PROPERTY) = 0"&gt;
        &lt;PROPERTY&gt;
          &lt;xsl:attribute name="_StreetAddress"&gt;
            &lt;xsl:value-of select="@StreetAddress"/&gt;
          &lt;/xsl:attribute&gt;
          &lt;xsl:attribute name="_StreetAddress2"&gt;
            &lt;xsl:value-of select="@StreetAddress2"/&gt;
          &lt;/xsl:attribute&gt;
          &lt;xsl:attribute name="_City"&gt;
            &lt;xsl:value-of select="@City"/&gt;
          &lt;/xsl:attribute&gt;
          &lt;xsl:attribute name="_State"&gt;
            &lt;xsl:value-of select="@State"/&gt;
          &lt;/xsl:attribute&gt;
          &lt;xsl:attribute name="_PostalCode"&gt;
            &lt;xsl:value-of select="@PostalCode"/&gt;
          &lt;/xsl:attribute&gt;
          &lt;xsl:attribute name="_County"&gt;
            &lt;xsl:value-of select="@County"/&gt;
          &lt;/xsl:attribute&gt;
          &lt;xsl:apply-templates select="LEGAL_DESCRIPTION"/&gt;
        &lt;/PROPERTY&gt;
      &lt;/xsl:when&gt;
      &lt;xsl:otherwise&gt;
        &lt;xsl:apply-templates select="PROPERTY" /&gt;
      &lt;/xsl:otherwise&gt;
    &lt;/xsl:choose&gt;
    &lt;xsl:choose&gt;
      &lt;xsl:when test="count(PARTIES) = 0"&gt;
        &lt;PARTIES&gt;
          &lt;_RETURN_TO_PARTY _UnparsedName="" _StreetAddress="" _StreetAddress2="" _City="" _State="" _PostalCode="" /&gt;
        &lt;/PARTIES&gt;
      &lt;/xsl:when&gt;
      &lt;xsl:otherwise&gt;
        &lt;xsl:apply-templates select="PARTIES" /&gt;
      &lt;/xsl:otherwise&gt;
    &lt;/xsl:choose&gt;
    &lt;xsl:apply-templates select="EXECUTION" /&gt;
    &lt;xsl:apply-templates select="CONSIDERATION" /&gt;
    &lt;xsl:apply-templates select="RECORDABLE_DOCUMENT/_ASSOCIATED_DOCUMENT" /&gt;
    &lt;xsl:apply-templates select="EMBEDDED_FILE" /&gt;
  &lt;/PRIA_DOCUMENT&gt;
  </code></pre>
  
  <p></p>
  
  <p>Source XML:</p>
  
  <pre><code>&lt;REQUEST_GROUP PRIAVersionIdentifier="2.4"&gt;
    &lt;REQUEST&gt;
      &lt;PRIA_REQUEST _Type="RecordDocuments"&gt;
        &lt;PACKAGE&gt;
          &lt;PRIA_DOCUMENT PRIAVersionIdentifier="2.4" RecordableDocumentSequenceIdentifier="1" RecordableDocumentType="Mortgage"&gt;
  </code></pre>
  
  <p>Resulting XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;ONCORE_ERECORD xmlns="http://test.com"&gt;
    &lt;DOCUMENT_RECORDATION xmlns="http://test2.org"&gt;
      &lt;PRIA_DOCUMENT _PRIAVersion="1.2" _Type="Mortgage" _Code="" xmlns=""&gt;
  </code></pre>