Receiving XML that is almost valid can be a real pain - it certainly used to be that some XML parsers didn't report some weird errors in a particularly helpful way requiring manual scrutiny.
I have unpleasant memories of trying to work out why some SOAP web service was breaking and it turned out the WSDL was invalid in a subtle way.
https://stackoverflow.com/questions/21087648/xml-invalid-cha...
I know about this because I received a file with illegal CDATA characters once.