DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
DOMImplementation impl = builder.getDOMImplementation();
DocumentType doctype = impl.createDocumentType("wms", "WMT_MS_Capabilities",
"http://schemas.opengis.net/wms/1.1.1/WMS_MS_Capabilities.dtd");
doc = impl.createDocument(null, "WMT_MS_Capabilities", doctype);
} catch (javax.xml.parsers.ParserConfigurationException ex) {
throw new RuntimeException("Cannot create new Xml Document:" + ex.getMessage());
}
Element root = doc.getDocumentElement();