If JRE-implementation you use to run you applications doesn't contain a built-in DOM-implementation (or you do not like it) you can configure it using system properties. When DocumentBuilderFactoryis asked to produce new instances, it searches system properties for entry with name javax.xml.parsers.DocumentBuilderFactory. This property should contains a name of the class implementing DOM . Example below shows how to force Apache implementation of DOM:

   // configure DOM-implementation we want to use:
  // now use JAXP interface to instantiate DOM-implementation:
  DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
  // then we have to create document-loader:
  DocumentBuilder loader = factory.newDocumentBuilder();