public static void assertXMLFilesEquals(XmlPullParser expectedXMLParser,
			XmlPullParser testXMLParser) {

		Deque<String> currentPath = new ArrayDeque<>();

		while (expectedXMLParser.peek() != null && testXMLParser.peek() != null) {
			XmlElement expectedElement = expectedXMLParser.next();
			XmlElement testElement = testXMLParser.next();

			if (expectedElement.isStart()) {
				currentPath.addLast(expectedElement.getName());
			}

			if (expectedElement.isStart() != testElement.isStart() ||
				expectedElement.isEnd() != testElement.isEnd()) {
				failWithInfo("Element start/stop type does not match", expectedXMLParser,
					testXMLParser, expectedElement, testElement, currentPath);
			}

			if (!expectedElement.getName().equals(testElement.getName())) {
				failWithInfo("Element names do not match", expectedXMLParser, testXMLParser,
					expectedElement, testElement, currentPath);
			}

			if (expectedElement.isStart()) {
				Map<String, String> testAttrs = testElement.getAttributes();
				for (Entry<String, String> expectedAttr : expectedElement.getAttributes()
						.entrySet()) {
					if (!testAttrs.containsKey(expectedAttr.getKey())) {
						failWithInfo("Attribute " + expectedAttr.getKey() + " missing",
							expectedXMLParser, testXMLParser, expectedElement, testElement,
							currentPath);
					}
					String testAttrVal = testAttrs.get(expectedAttr.getKey());
					if (!expectedAttr.getValue().equals(testAttrVal)) {
						failWithInfo("Attribute " + expectedAttr.getKey() + " values do not match",
							expectedXMLParser, testXMLParser, expectedElement, testElement,
							currentPath);
					}
					testAttrs.remove(expectedAttr.getKey());
				}
				if (!testAttrs.isEmpty()) {
					failWithInfo("Unexpected attributes found: " + testAttrs.keySet().toString(),
						expectedXMLParser, testXMLParser, expectedElement, testElement,
						currentPath);
				}
			}

			if (expectedElement.isEnd()) {
				String expectedContent = expectedElement.getText().trim();
				String testContent = testElement.getText().trim();
				if (!expectedContent.equals(testContent)) {
					failWithInfo(
						"Text content does not match: /" + expectedContent + "/ vs /" +
							testContent + "/",
						expectedXMLParser, testXMLParser, expectedElement, testElement,
						currentPath);
				}
				currentPath.removeLast();
			}
		}

	}
@see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException)
Ghidra/Features/Base/src/main/java/ghidra/util/xml/XmlTestHelper.java