Q: How to validate a XML file with a specific schema file? A: import java.io.IOException; import java.util.LinkedList; import nu.xom.Builder; import nu.xom.Document; import nu.xom.ParsingException; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; import org.xml.sax.helpers.XMLReaderFactory; ... try { /* * Set specific SAX parser option, to validate the XML file with a the schema */ XMLReader xerces = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser"); xerces.setFeature("http://apache.org/xml/features/validation/schema", true); xerces.setProperty("http://apache.org/xml/properties/schema/external-schemaLocation", SCHEMA_LOCATION); Builder parser = new Builder(xerces,true); Document doc = parser.build(xmlDocument); System.out.println(xmlDocument + " is schema valid."); } catch (ParsingException ex) { System.err.println("XML File is malformed."); } catch (IOException ex) { System.err.println("Problems reading the XML file."); } catch (SAXException e) { e.printStackTrace(); } } ... Q: How to get all the nodes with a specific name? A: #XML FILE: Model 1 Tube 1 3 Model 2 Tube 1 4 #Example of java code to get all Compatibility nodes 1st - Get the root node 2nd - Get all the children of the root node import nu.xom.Element; import nu.xom.Elements; ... Element rootNode = doc.getRootElement(); Elements constraints = rootNode.getChildElements(); Element constraint; ...