I directly respond here since the problem has been first discussed on this list.
> eXist ignores the first member of the union. Good luck getting that
Well, it was quite easy to locate the real cause once I knew the
problem is there. The issue only occurs with union expressions where
one of the node sets is the result of a wildcard name test. A
preliminary fix can be found here:
Basically, you need to comment out two lines in
org.exist.dom.VirtualNodeSet, method contains(NodeProxy). I still have
to find out who (me?) added those two lines and why he did it. Looks
like a (wrong!) dirty hack.