The BuildHierarchy() function builds a tree structure over a list of nodes of identical type that are hierarchically related.
The relevant nodes (1st parameter) must have a key field (2nd parameter) that is referenced by another field within the child node (3rd parameter). The function returns a tree with the following structure:
<TreeResult> <RootNodes Key='X'> <Items></Items> <Nodes></Nodes> </RootNodes> <TreeResul>
BuildHierarchy('Node', 'Key'.'Key of the parent node')
BuildHierarchy('//SG_33', '@DE_1082'.'LIN/DG_C829/@DE_1082')
Note: Alternate solution Hierarchiebildung mit der Funktion SplitToArray()