Add function to modify a tree child in-place.