You get duplicates because your filter does not evaluate how you think.
The local-name () function returns the local name of the first node in the set of nodes.
, , - , .
, , , XPATH 1.0. XPATH 2.0, Firefox.
XSLT meunchien, , .
. - XML, (,//* ):
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"><xsl:output method="xml"/>
<xsl:key name="names" match="//*" use="local-name(.)"/>
<xsl:template match="/">
<xsl:for-each select="//*[generate-id(.) = generate-id(key('names', local-name(.)))]">
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>