Given the document:
<vendors> <vendor><name>Dell</name>...</vendor> <vendor><name>Apple</name>...</vendor> <vendor><name>HP</name>...</vendor> </vendors>
This would sort the vendor elements:
<xsl:template match="vendors"> <xsl:copy> <xsl:apply-templates select="vendor"> <xsl:sort select="name"/> </xsl:apply-templates> </xsl:copy> </xsl:template> <xsl:template match="vendor"> <xsl:copy-of select="."/> </xsl:template>