Couldn't you count the tabs, and then get the ' Parent ' property of the node just added? In your example
Top Node1 ( no tab, new main node. )
Child Node1_1 ( one tab more than previous, so it is owned by previous )
Child Node1_2 ( same amount of tabs, owned by previous parent )
Child Node1_2_1 ( one more tab than previous, so it is owned by previous )
Top Node2 ( no tab, new main node. )
Top Node3 ( no tab, new main node. )
Child Node3_1 ( one tab more than previous, so it is owned by previous )
Child Node3_2 ( same amount of tabs, owned by previous parent )
Child Node3_2_1 ( one tab more than previous, so it is owned by previous )
Child Node3_2_1_1 ( one tab more than previous, so it is owned by previous )
Child Node3_2_1_1_1 ( one tab more than previous, so it is owned by previous )
Child Node3_2_1_2 ( one tab less than previous, so it is owned by previous parent's parent )
There is also a ' PrevNode ' property that may be of help also.