fix error in XML parser

I found this fix in skizilkaya pull request and fix my fork. Without
this fix, parsing fail.