[FIX] XQuery, revert to original locking code