Here's another generic XSLT question which may be in the FAQ, but I'll
give a hint here:
Given <A xmlns:a="a-ns"><B xmlns:b="b-ns"><C /></B></A>
>If I have the 'C' Element, how do I get a list which contains the 'a'
>and 'b' namespace desclarations, which are in scope?
General idea:
<xsl:template match="C">
<xsl:for-each select="namespace::*">
<xsl:value-of select="namespace-uri(.)"/><xsl:text>;</xsl:text>
</xsl:for-each>
</xsl:template>
Get that working, then alter it to suit your needs.
.................David Marston