In This version I try to avoid duplicate in the tree index!!
In the last version I have commit a wrong version of module.
This version is patch version to fix the problem of duplicated node.
In the recursive query now i force a full match with the nid and vid to use only active version of node.