Convert parent child to nested set trees