Here you can find the source of getChildren(Node node, String name)
public static List<Node> getChildren(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> getChildren(Node node, String name) { List<Node> children = new ArrayList<Node>(); NodeList nodes = node.getChildNodes(); if (nodes != null && nodes.getLength() > 0) { for (int i = 0; i < nodes.getLength(); i++) { Node n = nodes.item(i); if (name.equals(n.getNodeName())) { children.add(n);/*from w w w. ja v a 2 s .c om*/ } } } return children; } }