Whenever I get the task of transforming some XML to some other XML using XSL and namespaces are involved it is always a struggle for some reason. And I've experienced that I'm not the only one having problems with that.
XSL transformation document
<?xml version="1.0" encoding="ISO-8859-1"?>
<catalog xmlns="http://schemas.maze-dev.blogspot.com/2010/catalog">
<name>Absolute Whatever Vol. 1</name>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<cd>
<title>Hide your heart</title>
<artist>Bonnie Tyler</artist>
<country>UK</country>
<company>CBS Records</company>
<price>9.90</price>
<year>1988</year>
</cd>
<cd>
<title>Greatest Hits</title>
<artist>Dolly Parton</artist>
<country>USA</country>
<company>RCA</company>
<price>9.90</price>
<year>1982</year>
</cd>
</catalog>
Output XML document
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://schemas.maze-dev.blogspot.com/2010/archive"
xmlns:cat="http://schemas.maze-dev.blogspot.com/2010/catalog" exclude-result-prefixes="cat">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<archive>
<xsl:apply-templates select="cat:catalog"/>
</archive>
</xsl:template>
<xsl:template match="cat:catalog">
<name><xsl:value-of select="cat:name"/></name>
<xsl:apply-templates select="cat:cd"/>
</xsl:template>
<xsl:template match="cat:cd">
<album>
<title>Title: <xsl:value-of select="cat:title"/></title>
<artist>Artist: <xsl:value-of select="cat:artist"/></artist>
</album>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<archive xmlns="http://schemas.maze-dev.blogspot.com/2010/archive">
<name>Absolute Whatever Vol. 1</name>
<album>
<title>Title: Empire Burlesque</title>
<artist>Artist: Bob Dylan</artist>
</album>
<album>
<title>Title: Hide your heart</title>
<artist>Artist: Bonnie Tyler</artist>
</album>
<album>
<title>Title: Greatest Hits</title>
<artist>Artist: Dolly Parton</artist>
</album>
</archive>