Try the XML version of this page.
If you have problems with it, consult the
This page will hold information about how to construct hierarchical output from flat
XML sources. For now, there's the following post:
Adding Nested Sections to HTML
XSLT Recommendation: Keys
/xslt/hierarchies-out.xml by Jeni Tennison; generated using SAXON 6.5.2 from Michael Kay