For this XML:
<?xml version="1.0"?>
<colors>
<color>Red</color>
<color>Red</color>
<color>Blue</color>
</colors>
Using this XSD:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method = "text" />
<xsl:strip-space elements="*"/>
<xsl:template match="colors">
<xsl:for-each select="color">
<xsl:variable name="node_color" select="text()"/>
<xsl:variable name="numEntries" select="count(../color[text()=$node_color])"/>
<xsl:if test="$numEntries > 1">
<xsl:text>Color value of </xsl:text><xsl:value-of select="."/><xsl:text> has multiple entries 
</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
I got this output:
Color value of Red has multiple entries
Color value of Red has multiple entries
So that will at least find them, but it will report each occurrence of a repeated color, not just every repeated color.