You could use xpath to search through an XML document.
Here is an example:
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setIgnoringComments(true);
DocumentBuilder parser = dbf.newDocumentBuilder();
Document doc = parser.parse(yourfile.xml);
String text = "Text to search for";
// look for the text somewhere in a nested Element
XPath xpath = XPathFactory.newInstance().newXPath();
NodeList nodes = (NodeList)xpath.evaluate("//*[contains(text(),'" + text + "')]", doc, XPathConstants.NODESET);
for (int i = 0, n = nodes.getLength(); i < n; i++) {
Node node = nodes.item(i);
String path;
path = node.getNodeName() + '/' + node.getTextContent()
}
This should search through the XML and return any values that contain your search text.