Java tutorial
//package com.java2s; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpression; import javax.xml.xpath.XPathExpressionException; import org.w3c.dom.Node; public class Main { public static Node oneOf(Node parent, XPathExpression... exprs) throws XPathExpressionException { for (XPathExpression expr : exprs) { Node child = (Node) expr.evaluate(parent, XPathConstants.NODE); if (child != null) { return child; } } return null; } }