A fix for PBUG-149, handle bad XML a bit better