while (toHere.getName().equals(name) && toHere.toNextSibling()) {
while (name.equals(toHere.getName()) && toHere.toNextSibling()) {
    private static void moveElements(String localName, XmlCursor moveable, XmlCursor toHere) {        QName name = new QName(J2EE_NAMESPACE, localName);        //skip elements already in the correct order.        while (toHere.getName().equals(name) && toHere.toNextSibling()) {        }        moveable.toCursor(toHere);        while (moveable.toNextSibling(name)) {            moveable.moveXml(toHere);        }    }