SI-9027 Backport xml parser fix

Fingers crossed, I have no local java 6 here to test.

No test because no q"" on 2.10.
Merge pull request #4186 from som-snytt/issue/9027-backport

SI-9027 Backport xml parser fix