XQuery Lexer Improvements

Fix bugs in XQuery lexer. Add safeguard to avoid infinite loop in the XQueryLexer.