Here you can find the source of findElementByTag(Set
public static Node findElementByTag(Set<Node> nodes, String tag)
//package com.java2s; // License as published by the Free Software Foundation; either import java.util.Set; import org.w3c.dom.Node; public class Main { public static Node findElementByTag(Set<Node> nodes, String tag) { Node result = null;/*from ww w. jav a 2 s .c om*/ for (Node child : nodes) { if (tag.equals(child.getNodeName())) { result = child; break; } } return result; } }