Q:

How to remove the namespace name without removing the namespace declaration

I'm still pretty new to XSLT and I have the following XML which I need to remove the namespace.  I also found the following XSLT which almost gets the job done with the exception that it will not retain the xmlns declaration.  
XML:
<?xml version="1.0" encoding="UTF-8"?>
<etd_ms:thesis xmlns:etd_ms="http://www.ndltd.org/standards/metadata/etdms/1.0/"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://www.ndltd.org/standards/metadata/etdms/1.0/ http://www.ndltd.org/standards/metadata/etdms/1.0/etdms.xsd">
   <etd_ms:title>Aspects of negritude in the works of two Harlem renaissance authors : Claude McKay and Langston Hughes</etd_ms:title>
   <etd_ms:creator>Charles, Asselin</etd_ms:creator>
   <etd_ms:subject/>
   <etd_ms:publisher>Concordia University</etd_ms:publisher>
   <etd_ms:contributor role="advisor">Butovsky, M</etd_ms:contributor>
   <etd_ms:date>1980</etd_ms:date>
   <etd_ms:type>Electronic Thesis or Dissertation</etd_ms:type>
   <etd_ms:identifier>TC-QMG-1</etd_ms:identifier>
   <etd_ms:format>text</etd_ms:format>
   <etd_ms:identifier>https://spectrum.library.concordia.ca/1/1/MK49585.pdf</etd_ms:identifier>
   <etd_ms:language>en</etd_ms:language>
   <etd_ms:degree>
      <etd_ms:name>M.A.</etd_ms:name>
      <etd_ms:level>masters</etd_ms:level>
      <etd_ms:discipline>Dept. of English</etd_ms:discipline>
      <etd_ms:grantor>Concordia University</etd_ms:grantor>
   </etd_ms:degree>
</etd_ms:thesis>

and here's the XSLT:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:output indent="yes" method="xml" encoding="utf-8" omit-xml-declaration="no"/>

    <!-- Stylesheet to remove all namespaces from a document -->
    <!-- NOTE: this will lead to attribute name clash, if an element contains
        two attributes with same local name but different namespace prefix -->
    <!-- Nodes that cannot have a namespace are copied as such -->

    <!-- template to copy elements -->
    <xsl:template match="*">
        <xsl:element name="{local-name()}">
            <xsl:apply-templates select="@* | node()"/>
        </xsl:element>
    </xsl:template>

    <!-- template to copy attributes -->
    <xsl:template match="@*">
        <xsl:attribute name="{local-name()}">
            <xsl:value-of select="."/>
        </xsl:attribute>
    </xsl:template>

    <!-- template to copy the rest of the nodes -->
    <xsl:template match="comment() | text() | processing-instruction()">
        <xsl:copy/>
    </xsl:template>

</xsl:stylesheet>

The results is the following:
<?xml version="1.0" encoding="UTF-8"?>
<thesis xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.ndltd.org/standards/metadata/etdms/1.0/ http://www.ndltd.org/standards/metadata/etdms/1.0/etdms.xsd">
   <title>Aspects of negritude in the works of two Harlem renaissance authors : Claude McKay and Langston Hughes</title>
   <creator>Charles, Asselin</creator>
   <subject/>
   <publisher>Concordia University</publisher>
   <contributor role="advisor">Butovsky, M</contributor>
   <date>1980</date>
   <type>Electronic Thesis or Dissertation</type>
   <identifier>TC-QMG-1</identifier>
   <format>text</format>
   <identifier>https://spectrum.library.concordia.ca/1/1/MK49585.pdf</identifier>
   <language>en</language>
   <degree>
      <name>M.A.</name>
      <level>masters</level>
      <discipline>Dept. of English</discipline>
      <grantor>Concordia University</grantor>
   </degree>
</thesis>

It's almost there, with the exception that I need to keep the xmlns declaration, so ultimatly the root element should be something like:
<thesis xmlns="http://www.ndltd.org/standards/metadata/etdms/1.0/"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.ndltd.org/standards/metadata/etdms/1.0/ http://www.ndltd.org/standards/metadata/etdms/1.0/etdms.xsd">

Can someone help me resolving this issue?  Thanks.

A:

Change
<xsl:element name="{local-name()}">

to
<xsl:element name="{local-name()}" namespace="http://www.ndltd.org/standards/metadata/etdms/1.0/">

