comparing node-sets within the same XML document...

Is it possible to compare two node-sets to one another using XPath ? For example I have the following XML:


<test>
<object>
<set attribute="att1" value="value1"/>
<set attribute="att2" value="value2"/>
</object>
<object>
<set attribute="att2" value="value2"/>
<set attribute="att3" value="value3"/>
</object>
</test>


And want to know if the contents of (i.e. set nodes) the second object is equal to the first instance. Is it possible to union the object elements? Where a union statement merging all identifical node-sets? A normal union (i.e. node-set | node-set) returns all instances not only unique sets.

Basically what I want to do is with a XSL translation determine if a particular node set is unique within a XML document. But without using extension functions.

thanks / Matthew Young