Example 2: Creating an XML DOM in C++.

// Create a new XML DOM Document
DOMImplementation* dom 
    = DOMImplementationRegistry::getDOMImplementation("Core");
DOMDocument doc = dom->createDocument(
    NULL,       // namespace URI.
    "Customer", // root element name
    NULL );     // DTD
// Get the root element Node object
DOMElement* rootElem = doc->getDocumentElement();