get node children and refs in the same function