function to convert server-side-tree into ui-ree