Rewrote predicate in a simpler way. Avoids bug in xqlint