Get all nodes from binary tree that have relationship