The simplest is
count($values) = count(distinct-values($values))
In practice you may be interested then to find out where the duplicates are, which you can do using for-each-group
<xsl:for-each-group select="$values" group-by=".">
<xsl:if test="count(current-group()) gt 1">
...
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference