NativeXml Help
TXmlNode.TreeDepth
function TreeDepth: integer;
Description
Read TreeDepth to find out many nested levels there are for the current XML node. Root has a TreeDepth of zero.