Here you can find the source of getChildrenOfName(Node node, String name)
public static List<Node> getChildrenOfName(Node node, String name)
//package com.java2s; 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> getChildrenOfName(Node node, String name) { List<Node> res = new ArrayList<Node>(); NodeList childNodes = node.getChildNodes(); for (int i = 0; i < childNodes.getLength(); i++) { Node item = childNodes.item(i); String localName = item.getNodeName(); if (name.equals(localName)) { res.add(item);//from w w w . ja va 2s .c o m } } return res; } }