Unlike sorting, grouping is not directly supported in XSLT. Most axes and functions you'd like to use for grouping work only with the document order of the XML document, not with the sorted order you'd need for grouping. That being said, you can use some tricks to group elements in your output document. This subject is discussed in great detail in Section 6.2, "Grouping Nodes" in Chapter 6, "Sorting and Grouping Elements".
Copyright © 2002 O'Reilly & Associates. All rights reserved.