find all elements by xpath java code example
Example: how to get all the elements in xpath java
XPathExpression expr = xpath.compile("//Yourpath");
NodeList list= (NodeList) expr.evaluate(doc, XPathConstants.NODESET);
for (int i = 0; i < list.getLength(); i++) {
Node node = list.item(i);
System.out.println(node.getTextContent());