The pool element is created at the root of the XML tree by default. However, sub-workflow instances may use any element in the data tree. In the product process, $Xml points to the Product element. For the Order process (as a sub-workflow of the Product process), $Xml points to the Order element where the sub-workflow is initiated. For rules on the Amount field, $Xml points to the Amount element.
Because $Xml may point to different elements in the data model, in some cases you may need to access the pool root element. Use the $poolRoot variable, or an absolute XPath that starts at the document element, such as /*[1]/Product. Do not write paths such as Product/Id from a nested element: relative paths always start at the current element.
$Xml.AppendChild: Appends a new child to the specified XPath location and executes the provided callback function on the newly created node before inserting it into the DOM. Returns the appended new node.
$Xml.Clone: Creates a detached deep copy of the current node.
$Xml.Copy: Copies the current XML node and all its child nodes from the source XPath to the target XPath or target navigator.
$Xml.Remove: Removes the current node and returns it in an array.
$Xml.Sync: Synchronizes the nodes at the specified XPath with the input nodes, and returns an array of the synchronized nodes.
$Xml.Assert: Performs an error check by asserting that the specified XPath evaluates to a boolean true value. If the assertion fails, an error is thrown.
$Xml.CommitDeletes: Deletes all child nodes that have the State attribute set to the value 'Deleted'.