build the initial fragment from tree