You could use the standard Munchian methods to remove duplicates. However, this is an inefficient way of getting min and max anyway. A better approach is to do a sort and take the first/last in the sorted sequence - this won't give you any duplicates.
<xsl:for-each select="xxx">
<xsl:sort .../>
<xsl:if test="position()=1">
<first>...</first>
<xsl:if test="position()=last()">
<last>...</last>
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference