It is possible with XBinder to encode a populated data structure to a W3C-compliant Document Object Model (DOM) structure instead of directly to XML. This is done by using the -dom command-line switch. When this is done, the suffix _toDOM is added to generated encode functions.
The calling sequence is also changed to contain a pointer to a Document root node object:
[ns]XmlEnc_<elemName>_toDOM (OSCTXT* pctxt, <typeName>[*] value, OSRTDOMNodePtr* ppRootNode);
The root node is a generic object pointer that points to the head of the DOM tree. It is defined in domAPI.h be a void pointer. A concrete DOM implemention would define the actual structure. The default DOM implementation in domAPI.c defines a mapping to the libxml2 DOM implementation.