You could look on the namepace axis of the root element of your XSLT code e.g.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:y="http://www.w3.org/1999/xhtml" version="1.0">
<xsl:output method="text" indent="yes"/>
<xsl:variable name="xslt-root" select="document('')/*"/>
<xsl:template match="*">
<xsl:value-of select="concat(local-name($xslt-root/namespace::*[. = namespace-uri(current())]), ':', local-name())"/>
</xsl:template>
</xsl:stylesheet>