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.

This is backport of #4185.