Here you can find the source of getChildNodesByName(Node node, String name)
public static List<Node> getChildNodesByName(Node node, String name)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static List<Node> getChildNodesByName(Node node, String name) { List<Node> result = new ArrayList<Node>(); NodeList childList = node.getChildNodes(); for (int i = 0; i < childList.getLength(); ++i) { Node child = childList.item(i); if (child.getNodeName().equals(name)) { result.add(child);// w w w.ja v a2s . co m } } return result; } }