What I don't understand is why you don't just save your own id in memory on all those nodes? It's still not a virtual dom because there is no separate dom tree, you are still just walking the dom itself.