A very simple example to search for XML acronyms. The required XML source document is available from The XML Acronym Demystifier. Just download the XML source and store it into an arbitrary database collection. Then reload this page and enjoy!

Search for | List of keywords
--- | ---

String field = request.getParameter("field"); String term = request.getParameter("term"); if(term != null && term.length() > 0) { String path; if(field.equals("acronym")) path = "a:Acronym/@id|.//a:AlternateForm"; else if(field.equals("expansion")) path = "a:Acronym/@expansion"; else if(field.equals("definition")) path = "a:Definition"; else path = "."; String query = "declare namespace a='http://www.xml-acronym-demystifier.org';" + "//a:Entry[" + path + " &= " + '"' + term + "\"]"; <entries> query </entries> }