build tree of complexTypes functional