Nike
13
White
With //shoes/additional you would get a list of all the nodes and could iterate over it in Java.
Here's an example that uses XPath
from the JDK to execute a query. It assumes that the variable xml
contains your XML document.
XPathFactory factory = XPathFactory.newInstance();
XPath xPath = factory.newXPath();
NodeList nodeList = (NodeList) xPath.evaluate("//shoes/additional", new InputSource(new StringReader(xml)), XPathConstants.NODESET);
for (int i = 0; i < nodeList.getLength(); ++i) {
String name = nodeList.item(i).getAttributes().getNamedItem("name").getNodeValue();
String text = nodeList.item(i).getTextContent();
System.out.println(name + ", " + text);
}