title: Remove namespace entry from element, which was added by XSLT during transformation
body: <p>I'm using the xslt file to convert set of xml files, some of the tags in xml are defined in another namespace. </p>
  
  <p>What xslt does is from AddBooks element tag first copy everything, except the bookattach element where attribute bookname = 'AA12' then construct a new element bookattach where bookname="AA12" in all cases and copy into it all the children of bookattach where bookname="AA12" and bookname="A12".</p>
  
  <p>Well the xslt is working as expected but the problem is that when it copies element bookattach where attribute bookname = 'AA12' there its adding the name space entry. For example it copies an entry as:</p>
  
  <pre><code>&lt;bookattach xmlns:mynamespace="http://myorg.com/mymodel/Library" bookname="AA12"&gt;
  &lt;book bookname="bacbook1" description="This is test book1"/&gt;
  &lt;/bookattach&gt;
  </code></pre>
  
  <p>I do not want to copy this namespace entry in the transformed xml, (my source xml also does not contain namespace entry in bookattach tag),
  so how can I get rid of this namespace entry in this specific tag?</p>
  
  <p>My xslt is as below:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  xmlns:mynamespace="http://myorg.com/mymodel/Library"
                  version="1.0"&gt;
  
  &lt;xsl:output method="xml" encoding="UTF-8" indent="yes" /&gt;
  
      &lt;xsl:output method="xml"/&gt;
  
      &lt;xsl:key name="bookbyid" match="mynamespace:bookattach" use="@bookname"/&gt;
  
      &lt;xsl:template match="mynamespace:AddBooks"&gt;
          &lt;xsl:copy&gt;
            &lt;xsl:apply-templates select="@*|node() [ not( (self::mynamespace:bookattach and @bookname = 'AA12') )]"/&gt;
            &lt;bookattach bookname="AA12"&gt;
                &lt;xsl:copy-of select="key('bookbyid','AA12')/*"/&gt;
                &lt;xsl:for-each select="key('bookbyid','A12')/*"&gt;
                    &lt;xsl:if test="not(./@bookName = key('bookbyid','AA12')/*/@bookName)"&gt;
                        &lt;xsl:copy-of select="."/&gt;
                    &lt;/xsl:if&gt;
                &lt;/xsl:for-each&gt;
            &lt;/bookattach&gt;
        &lt;/xsl:copy&gt;
      &lt;/xsl:template&gt;
  
      &lt;xsl:template match="@*|node()"&gt;
          &lt;xsl:copy&gt;
              &lt;xsl:apply-templates select="@*|node()"/&gt;
          &lt;/xsl:copy&gt;
      &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>