Using XQuery to remove duplicate values or duplicate nodes from an xml instance
Sometimes we need to retrieve a list distinct values from within an xml instance or even distinct nodes and this is relatively straight forward using XQuery. It gets a bit more complicated if you have attributes in the xml, but it is still possible to retrieve unique xml nodes. On the flip side, it is also possible to only return xml nodes that are duplicated in the xml instance. All the examples can be downloaded here
Retrieving Distinct Values
Getting a list of distinct atomic values from a … more