public static Element[] getNextSiblings(Element element, String namespaceUri, String localName) { List childElements = new ArrayList(); Element parent = (Element) element.getParentNode(); Element[] children = getChildren(parent, namespaceUri, localName);  int l = children.length; for (int i = 0; i < children.length; i++) { if (children[i] == element) { l = i; } if (i > l) { childElements.add(children[i]); } }  return (Element[]) childElements.toArray(new Element[childElements.size()]);
public static Element[] getNextSiblings(Element element, String namespaceUri) { return getNextSiblings(element, namespaceUri, "*");
    public static Element[] getNextSiblings(Element element, String namespaceUri, String localName) {        List childElements = new ArrayList();        Element parent = (Element) element.getParentNode();        Element[] children = getChildren(parent, namespaceUri, localName);        int l = children.length;        for (int i = 0; i < children.length; i++) {            if (children[i] == element) {                l = i;            }            if (i > l) {                childElements.add(children[i]);            }        }        return (Element[]) childElements.toArray(new Element[childElements.size()]);    }