get children from n-ary tree in correct order