It should return all first occurrences for nodes with same name, even if the childs and attribbutes differ.
For example
<Data>
<A>
<X randomattr="1"/>
<Y randomattr="1"/>
<Z/>
</A>
<B>
<X/>
<X randomattr="3"/>
<Z/>
</B>
</Data>
It sould return 3 nodes, first X, Y and Z, because the following, will have a repeated name. Don't mind if one of the X elements does not have randomattr or if another has a different value.
I dont want the distinct-values from name(), I want to return the whole node. Something like
/Data/*/*[distinct-values(name())]
I also know I can transverse all nodes with a double loop, but I am asking myyself if there is an easy one-liner or a function for this, or a special Xpath syntax like distinct[1] Thank u!