Here you can find the source of getChildElements(Element parent)
public static List<Element> getChildElements(Element parent)
//package com.java2s; //License from project: LGPL import java.util.ArrayList; import java.util.List; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static List<Element> getChildElements(Element parent) { List<Element> elems = new ArrayList<Element>(); NodeList nodes = parent.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { Node node = nodes.item(i); if (node.getNodeType() == Node.ELEMENT_NODE) { elems.add((Element) node); }//from w w w. j av a 2 s .com } return elems; } }