in reply to Validating XML

XML::LibXML has an option to recover from errors you might find useful.