Allows to access process data model. $Xml is a instance of XmlNode object and points the root of workflow instance pool.

Basic Usage
$Xml.SelectAll('//Customer', function(customer) {
  var id = customer.Evaluate('Id'); 

$Xml object points different elements depending of where used.

LocationRelated Element
Pool ScriptsPool Element
Route ValidationPool Element
Validation RuleControl Element
Formatting RuleControl Element

Pool element is created at root of XML tree by default but sub-workflow instances may use any element in data tree.

For example assume a following data model for a product process.

Example Data Model for Pool

In product process $Xml will be point to "Product" element.

For Order process (as a sub-workflow of Product process) $Xml will point the "Order" element where is sub workflow is initiated.

For rules on "Amount" field $Xml will point "Amount" element.

Accessing Pool Root

Because $Xml may point different elements in data model, in some cases you may need to access pool root element. You can use "/form/Product" xpath or "$poolRoot" variable if you need to access pool root.

Accessing pool root with xpath
var productId = $Xml.Evaluate('/*/Product/Id');
Accessing pool root with variable
var productId = $Xml.Evaluate('$poolRoot/Id');