Hierarchy tree entity encoding.