public @Nonnull XQuery get(String xpath) {
        NodeList nl = evaluate(xpath);
        if (nl.getLength() == 1) {
            return new XQuery(nl.item(0));
        } else if (nl.getLength() == 0) {
            throw new IllegalArgumentException("XPath '" + xpath
                + "' does not match any elements");
        } else {
            throw new IllegalArgumentException("XPath '" + xpath + "' matches "
                + nl.getLength() + " elements");
        }
    }
public @ Nonnull XQuery get ( String xpath ) { NodeList nl = evaluate ( xpath ) ; if ( nl . getLength ( ) == 1 ) { return new XQuery ( nl . item ( 0 ) ) ; } else if ( nl . getLength ( ) == 0 ) { throw new IllegalArgumentException ( "XPath '" + xpath + "' does not match any elements" ) ; } else { throw new IllegalArgumentException ( "XPath '" + xpath + "' matches " + nl . getLength ( ) + " elements" ) ; } }
Gets a single element based on the XPath expression that is applied to the tree
represented by this {@link XQuery}. Exactly one element is expected to match the
XPath expression, otherwise an exception is thrown.

@param xpath
XPath expression
@return Selected node
@since 1.1