private @ Nonnull NodeList evaluate ( String xpath ) { try { XPathExpression expr = xpf . newXPath ( ) . compile ( xpath ) ; return ( NodeList ) expr . evaluate ( node , XPathConstants . NODESET ) ; } catch ( XPathExpressionException ex ) { throw new IllegalArgumentException ( "Invalid XPath '" + xpath + "'" , ex ) ; } }
Evaluates the XPath expression and returns a list of nodes .