In fact, it's the first step in the oft-recommended Muenchian grouping
technique. (De-duplicate nodes by grouping criterion, then group by the set
of de-duplicated "flag-bearer" nodes.)
A common way to do this is simply to compare a node's value to other nodes
(here it's the value of the node's name that you care about):
node:definition/*[not(name() = name(preceding-sibling::*))]
Why should this take a long time? Isn't this the same as
*[not(name() = name(preceding-sibling::*[last()]))]
David
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list