In order to create an actual XML node, you use the CREATE-NODE( ) method on the parent object. After the node is created, you must append it to its parent by using the APPEND-CHILD( ) method. The following code fragment is an example of creating and appending the root node:

DEFINE VARIABLE hRoot AS HANDLE NO-UNDO.
CREATE X-NODEREF hRoot.
hDoc:CREATE-NODE(hRoot,"Root","ELEMENT").
hDoc:APPEND-CHILD(hRoot).
. . .