You could "fix" the XML by adding all the missing end-tags.
Any start-tag that contains text after the tag, on the same line, could be fixed by adding an end-tag at the end of the line.
The rule of "contains text" ensures that e.g. the <Manager>
tag doesn't get ended, since that is actually ended 3 lines down.
Example working code:
// Load file into memory
String xml = new String(Files.readAllBytes(Paths.get("test.xml")), StandardCharsets.UTF_8);
// Apply magic to add missing end-tags
xml = xml.replaceAll("(?m)^(\s*)<(\w+)>([^<]+)$", "$1<$2>$3</$2>");
// Parse then print the XML, to ensure there are no errors
Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder()
.parse(new InputSource(new StringReader(xml)));
TransformerFactory.newInstance().newTransformer()
.transform(new DOMSource(document), new StreamResult(System.out));
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…