Flatten children node text when handling 'tref' node
Apply rotations before handling white space on tail child