xmlDocSetRootElement is available since version 1.0.
Prototype:
number xmlDocSetRootElement(number doc, number root)
Parameters
doc
the XML document tree
root
the new document root element, if root is null no action is taken
Description:
Set the root element of the document (doc->children is a list containing possibly comments, PIs, etc).
Return value:
Returns the old root node (if any) or null.