[MIN] refactorings
[MOD] XQuery: several refactorings to simplify creation of XML fragments