This an example of XML file:
Gambardella, Matthew
You can combine DOM API with javax.xml.xpath.XPathFactory and javax.xml.xpath.XPath as descibed at http://developer.android.com/reference/javax/xml/xpath/package-summary.html.
For example:
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();;
DocumentBuilder builder = builderFactory.newDocumentBuilder();
Document document = builder.parse("input.xml");
// NodeList books = document.getElementsByTagName("book");
XPath xpath = XPathFactory.newInstance().newXPath();
String expression = "/catalog/book[1]/author"; // first book
Node author = (Node) xpath.evaluate(expression, document, XPathConstants.NODE);
if (author == null)
System.out.println("Element author not exists");
else
System.out.println(author.getTextContent());