<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template><xsl:apply-templates/></xsl:template>

<xsl:template match="employees">
  <ul>
    <xsl:apply-templates select="employee">
      <xsl:sort select="name/family"/>
      <xsl:sort select="name/given"/>
    </xsl:apply-templates>
  </ul>
</xsl:template>

<xsl:template match="employee">
  <li>
    <xsl:value-of select="name/given"/>
    <xsl:value-of select="name/family"/>
  </li>
</xsl:template>


</xsl:stylesheet>


Note that the order-by attribute syntax is obsolete. The December XSL Working Draft defines the xsl:sort element instead. Future releases will support the official syntax.

