Here you can find the source of findNode(String id, NodeList orgs)
public static Node findNode(String id, NodeList orgs)
//package com.java2s; //License from project: Apache License import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static Node findNode(String id, NodeList orgs) { Node org = null;//w w w.ja va 2s.co m for (int i = 0; i < orgs.getLength(); i++) { NamedNodeMap attr = orgs.item(i).getAttributes(); if (attr.getNamedItem("xml:id") == null) { continue; } if (attr.getNamedItem("xml:id").getNodeValue().equals(id)) { org = orgs.item(i); break; } } return org; } }