Here you can find the source of getChildElements(Element element)
public static List<Element> getChildElements(Element element)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.List; import org.w3c.dom.Element; import org.w3c.dom.NodeList; public class Main { public static List<Element> getChildElements(Element element) { List<Element> result = new ArrayList<Element>(); NodeList childNodes = element.getChildNodes(); for (int i = 0; i < childNodes.getLength(); i++) { if (childNodes.item(i) instanceof Element) { result.add((Element) childNodes.item(i)); }/*from w ww. j ava2 s. co m*/ } return result; } }