I am trying to sort all the actor names displayed in a list. There must be something simple that I'm missing but I just can't figure out what it is.\[code\] <xsl:key name="kName" match="actor/name" use="." /> <xsl:template match="/"> <xsl:element name="html"> <xsl:element name="head"> <xsl:element name="title"> <xsl:text>Actors list</xsl:text> </xsl:element> <xsl:element name="h2">Actors list</xsl:element> </xsl:element> <xsl:element name="body"> <xsl:variable name="actorNames" select="/movies/movie/cast/actors/actor/name"/> <xsl:apply-templates select="$actorNames[generate-id() = generate-id(key('kName', .)[1])]"> <xsl:sort select="./name"/> </xsl:apply-templates> </xsl:element> </xsl:element></xsl:template><xsl:template match="name"> <xsl:element name="a"> <xsl:attribute name="href">actor_details.php?movieID=<xsl:value-of select="../../../../@movieID"/>&actorID=<xsl:value-of select="../@actorID"/></xsl:attribute> <xsl:value-of select="." /> </xsl:element> <xsl:element name="br" /></xsl:template>\[/code\]