Well in XSLT 2.0 it is easy with the distinct-values function:
Code:
<xsl:for-each select="distinct-values(root/name)">
<xsl:value-of select="."/>
<br/>
</xsl:for-each>
Or you could use xsl:for-each-group select="root/name" group-by=".".
With XSLT 1.0 you could use Muenchian grouping. Let us know if you need help with that.