You can use the id()
function to get the node-set of all items that have been sold, using it on the node-set of products
attributes of transaction
elements:
id(//transaction/@products)
and you can easily extend that to get the type
of items that have been sold:
id(//transaction/@products)/@type
What you want is all products where the type
is not in this set, which is given by:
//product[not(@type = id(//transaction/@products)/@type)]
Using this on your example XML selects only beaverCoat
product node.