Here you can find the source of getElementByAttributeValue(List
public static Element getElementByAttributeValue(List<Element> elements, String attName, String attValue)
//package com.java2s; //License from project: Open Source License import java.util.List; import org.w3c.dom.Element; public class Main { public static Element getElementByAttributeValue(List<Element> elements, String attName, String attValue) { for (Element e : elements) { String s = e.getAttribute(attName); if (attValue.equals(s)) return e; }//w ww.j ava2 s.co m return null; } }