Convert XSLT 1.0 :
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:key name="kNamesByVal" match="Name" use="."/>
<xsl:template match="/">
<t>
<xsl:copy-of select=
"*/*/Name[generate-id()
=
generate-id(key('kNamesByVal', .)[1])
]
"/>
</t>
</xsl:template>
</xsl:stylesheet>
when applied to the provided XML document, it creates the desired, correct result :
<t>
<Name>HAREDIN </Name>
<Name>HARMENAK</Name>
</t>
XSLT 2.0 solution that does not use keys:
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="/">
<t>
<xsl:for-each-group select="*/*/Name" group-by=".">
<xsl:copy-of select="."/>
</xsl:for-each-group>
</t>
</xsl:template>
</xsl:stylesheet>
source
share