fixing XQuery processing