Android examples for XML:XML Attribute
find Next XML Element With Attribute
//package com.java2s; import org.w3c.dom.Element; import org.w3c.dom.Node; public class Main { public static Element findNextElementWithAttribute(Node ret, String name, String attribute, String value) { ret = ret.getNextSibling();/*from w w w . java2s . c om*/ while (ret != null && (!(ret instanceof Element) || !ret.getNodeName().equals(name) || ((Element) ret).getAttribute(attribute) == null || !((Element) ret) .getAttribute(attribute).equals(value))) { ret = ret.getNextSibling(); } return (Element) ret; } }