if (!test.getChars().equals(expected.getChars())) { problems.add("Different elements at elementCount: " + elementCount + ", test: " + test.getChars() + ", expected: " + expected.getChars());
String actualChars = test.getName().getLocalPart(); String expectedChars = expected.getName().getLocalPart(); if (!actualChars.equals(expectedChars)) { problems.add("Different elements at elementCount: " + elementCount + ", test: " + actualChars + ", expected: " + expectedChars);
    private boolean compareXmlObjects(XmlObject xmlObject, XmlObject expectedObject, List problems) {        XmlCursor test = xmlObject.newCursor();        XmlCursor expected = expectedObject.newCursor();        boolean similar = true;        int elementCount = 0;        while (toNextStartToken(test)) {            elementCount++;            if (!toNextStartToken(expected)) {                problems.add("test longer than expected at element: " + elementCount);                return false;            }            if (!test.getChars().equals(expected.getChars())) {                problems.add("Different elements at elementCount: " + elementCount + ", test: " + test.getChars() + ", expected: " + expected.getChars());                similar = false;            }            test.toNextToken();            expected.toNextToken();        }        return similar;    }