You can't control prefixes and namespace declarations very well.
There are a few things you can do:
Declare the namespaces you want in your result document on the root element as well as the stylesheet element.
Use xsl:element with a prefix to copy elements from the input to the output:
<xsl:template match="m:math"> <xsl:element name="m:{local-name(.)}" namespace="{namespace-uri(.)}"> <xsl:apply-templates select="@*|node()"/> </xsl:element> </xsl:template>
Use the exclude-result-prefixes attribute to exclude input and stylesheet prefix bindings.