more cautious XML parsing