The BDL API provides the function XMLCreateDocument to create an empty XML document. The function returns a handle to the created document. Use functions for creating and appending nodes to the document to build a valid XML document.
dcltrans transaction TMain var hDoc : number; begin hDoc := XmlCreateDocument(); ... XmlFreeHandle(hDoc); end TMain;