Here you can find the source of getNextElement(Node el)
public static Element getNextElement(Node el)
//package com.java2s; /* NOTICE: This file has been changed by Plutext Pty Ltd for use in docx4j. * The package name has been changed; there may also be other changes. * //w w w. ja v a 2 s. c om * This notice is included to meet the condition in clause 4(b) of the License. */ import org.w3c.dom.Element; import org.w3c.dom.Node; public class Main { public static Element getNextElement(Node el) { Node node = el; while (node != null && node.getNodeType() != Node.ELEMENT_NODE) { node = node.getNextSibling(); } return (Element) node; } }