[MOD] XQuery: refactoring of query resources (preparing #878)