Here you can find the source of findNextElement(Node ret, String name)
public static Element findNextElement(Node ret, String name)
//package com.java2s; import org.w3c.dom.Element; import org.w3c.dom.Node; public class Main { public static Element findNextElement(Node ret, String name) { ret = ret.getNextSibling();//w w w. ja va 2 s. c om while (ret != null && (!(ret instanceof Element) || !ret.getNodeName().equals( name))) { ret = ret.getNextSibling(); } return (Element) ret; } }