Recursive genealogy tree generation