XML is intolerant of errors. This program will automatically salvage XML files by finding the first XML error, then truncating a configurable number of characters before the error and finally using the great xmllint to recover the xml file by automatically adding the correct end tags. The program starts with a default of 50 characters truncation.
This truncation value may need to be changed if the truncation happens in the middle of a complex tag as xmllint may not know how to recover...