The hardest thing you can do in XSLT is to do a multi-level grouping. I had come up with a way using the Muenchian Method and "not (preceeding::...)" to manage multi-level grouping. It did the trick, but was very inefficent.
A sharp, young developer on my team pointed me to a post by Jeni Tennison at http://www.biglist.com/lists/xsl-list/archives/200101/msg00070.html that describes a great way to efficiently handle multiple level grouping in an xml file.
The basis is to concatenate the three parts of the key to make a unique key.
<xsl:key name="GLAccount" match="Record" use="concat(@site_id, ' ', @date, ' ', @glaccount)"/>
Take a look at the above link. It's worth reading.
Cheers,
John
Http://workdog.org