[FIX] XQuery predicate evaluation. Closes #947
Merge branch 'stable'