Here you can find the source of getChildElements(QName qName, Element element)
public static List<Element> getChildElements(QName qName, Element element)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.*; import javax.xml.namespace.QName; import java.util.ArrayList; import java.util.List; public class Main { public static List<Element> getChildElements(QName qName, Element element) { NodeList list = element.getElementsByTagNameNS(qName.getNamespaceURI(), qName.getLocalPart()); List<Element> elements = new ArrayList<>(); if (list == null || list.getLength() <= 0) { return elements; }/* ww w. j a v a 2 s . c om*/ for (int i = 0; i < list.getLength(); i++) { elements.add((Element) list.item(i)); } return elements; } }