Java tutorial
//package com.java2s; import java.util.LinkedList; import java.util.List; import org.w3c.dom.Element; import org.w3c.dom.NodeList; public class Main { public static List<Element> getChildsWithName(Element root, String name) { NodeList childNodes = root.getElementsByTagName(name); List<Element> elementList = new LinkedList<Element>(); for (int i = 0; i < childNodes.getLength(); ++i) { elementList.add((Element) childNodes.item(i)); } return elementList; } }