[ADD] XQuery: simplify nested predicates. Closes #984