I feel you're worried on "traverse the client document tree"
ItsNat makes a very strong effort of caching nodes to avoid traversing the client document from top, when ItsNat needs the tree location of a node first it will try to find a cached parent if found only the relative path is calculated.
In this example locById is not used because the same template is used for the initial page and for stateless events and location is correct.
Traversing for instance 20 levels of nodes is extremely fast, really, the unique case you may worry is when in the same level there are too many child nodes (an element with many child nodes) and you are targeting the last, in this moment I have no numbers but in modern browsers I don't see a problem if the number of nodes is not extremely big.