3 Using encode_entities makes this sort of thing happen:
5 XML Parsing Error: undefined entity
6 Location: http://XXX.YYY.ZZZ/
8 and points to the relevant entity.
10 I think using encode_entities_numeric would help a lot with this. This is just a naïve assessment, but this would prevent xml-like pages being non-xml.