As far as I know, you can use '|' just at the top level of the XPath query, so try running the query
"//artist|//author"
So far, a recursive search (//) is not very fast, so make sure your dom document is small.
Update:
I looked it up in the spec :
3.3 Node-sets
The location path can be used as an expression. The expression returns the set of nodes selected along the path.
The | The operator computes the union of its operands, which should be Node-sets.
This means that you write left and right of "|" should be used as an xpath request by itself, "|" it just creates an alliance from it.
In particular, you cannot say "search recursively for (something called by the author OR something called by the artist)" because "something called by the author" does not evaluate the result of the xpath request (node set).
source share