Hello. I am trying to generate XML logs from scratch using the Xerces-C library. I have found that I can load a dtd definitions file to use for the XercesDOMParser: http://xml.apache.org/xerces-c/apiDo...DOMParser.html using XercesDOMParser::loadGrammar and XercesDOMParser::setLoadExternalDTD but I am trying to write serialize a the log I use a DOMWrite: http://xml.apache.org/xerces-c/apiDo...DOMWriter.html like this

Code:
    DOMImplementationLS * impl = (DOMImplementationLS *)
        DOMImplementationRegistry::getDOMImplementation(XS("LS"));

    DOMWriter * writer = impl->createDOMWriter();

    if (writer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true))
        writer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true);
  
    if (writer->canSetFeature(XMLUni::fgDOMWRTBOM, true))
        writer->setFeature(XMLUni::fgDOMWRTBOM, true);

    XMLFormatTarget * ft = new LocalFileFormatTarget(m_file.c_str());
    
    writer->writeNode(ft, *m_doc);
    writer->release();
I cannot find any settings that would allow me to add a grammar to the serialization. I have found the class XMLGrammarPool: http://xml.apache.org/xerces-c/apiDo...ammarPool.html that has a method XMLGrammarPool::serializeGrammars, but I cannot figure out how to use it. In Java, I have seen code that uses an 'OutputFileFormat' class that has a OutputFileFormat.setDoctype method, but I cannot find any equivalent to use in the xerces-c API.

Kind of an obscure question, but does anyone have any insight?