XSLT provides the xsl:sort element to enable you to sort output from a transformation into the order that you want. If you want to sort by two criteria, you can nest xsl:sort elements inside each other.
Listing 12.6 uses the xsl:sort element to output all documents that are final before those that are drafts. Outdated documents are governed by the xsl:otherwise element and are not output.
<?xml version='1.0'?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:output method="html" indent="yes" /> <xsl:template match="/"> <html> <head> <title>XMML.com Documents</title> <style type="text/css"> ...