Copy class of the main tree element to the inner tree elements

Copy class of the main tree element to the inner tree elements