Here you can find the source of getNodes(String tagName, NodeList nodes)
public static List<Node> getNodes(String tagName, NodeList nodes)
//package com.java2s; //License from project: Apache 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> getNodes(String tagName, NodeList nodes) { List<Node> nodeList = new ArrayList<Node>(); for (int x = 0; x < nodes.getLength(); x++) { Node node = nodes.item(x); if (node.getNodeName().equalsIgnoreCase(tagName)) { nodeList.add(node);// w w w . j a v a 2 s .c o m } } return nodeList; } }