first draft of function to get a tree from ldsk structure