Here you can find the source of GetFirstInstance(NodeList nList)
public static String GetFirstInstance(NodeList nList)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); you may import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static String GetFirstInstance(NodeList nList) { for (int i = 0; i < nList.getLength(); i++) { Node nNode = nList.item(i); if (nNode.getNodeType() == Node.ELEMENT_NODE) { Element eElement = (Element) nNode; if (eElement != null) return eElement.getTextContent(); } // end if nnode.getnodetype() } //end for int temp return new String(""); }/*w w w .j av a2 s. c om*/ }