Java tutorial
//package com.java2s; import org.w3c.dom.*; public class Main { public static Element getElement(Document doc, String tagName, int index) { //Given an XML document and a tag return an Element at a given index NodeList rows = doc.getDocumentElement().getElementsByTagName(tagName); return (Element) rows.item(index); } }