code: public Element getElement(NodeList list, String key, String value) {
  	int len = list.getLength();
  	for (int i = 0; i < len; i++) {
  	    Node n = list.item(i);
  	    if (n instanceof Element) {
  		Element el = (Element) n;
  		if (el.getAttribute(key).equalsIgnoreCase(value)) return el;
  	    }
  	}
  	return null;
      }
docs: return XML Element matching name
  
  @param list source node list
  @param key key to compare
  @param value value to compare
  @return matching XML Element