Fixing bug in the XPathQueryParser.

Package and resource names should be able to contain underscores.

Also added test.