Increase robustness of xml parser (dmazar idea)