Core/src/main/java/org/openestate/io/core/XmlUtils.java
public static int countNodes(String xpathExpression, Document doc, Object context) throws JaxenException {
        return XmlUtils.newXPath(xpathExpression, doc).selectNodes(context).size();
    }
public static int countNodes(String xpathExpression, Document doc, Object context) throws JaxenException {
        return XmlUtils.newXPath(xpathExpression, doc).selectNodes(context).size();
    }
Count the number of nodes, that are matching against an XPath expression.

@param xpathExpression the XPath expression to match
@param doc             the document, on which the XPath expression is evaluated
@param context         the node, on which the XPath expression is evaluated
@return number of matching nodes
@throws JaxenException if the XPath evaluation failed