Creating Nodes

Newly created nodes can be appended at any place in the document. Nodes can be created in two ways - either with XmlCreateNode, which is creating an empty node, or with XmlCreateNodeFromXml, which creates a node from a valid XML node representation. Those two functions return a new node handle which can then be used to append to an existing node in the document. XmlAppendChild is the function that allows you to append the created node to an existing node. The appended node will become a child node of the parent node.
dcltrans
transaction TMain
var
  hNode1, hNode2 : number;
begin
  hNode1 := XmlCreateNode("child");
  hNode2 := XmlCreateNodeFromXml("<child attr1='attrvalue1'>value1</child>");
    ...
  XmlFreeHandle(hNode1);
  XmlFreeHandle(hNode2);
end TMain;