Possible option: Check in beforehand if input XML is erroneously truncated in the middle. (Might be problematic for url streams)