fixes in XQuery processing