Java tutorial
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Node; import org.w3c.dom.NodeList; import javax.annotation.Nullable; public class Main { @Nullable public static Node getNode(String tagName, NodeList nodes) { for (int x = 0; x < nodes.getLength(); x++) { Node node = nodes.item(x); if (node.getNodeName().equalsIgnoreCase(tagName)) { return node; } } return null; } }