I'm trying to move the nodes to the root of the tree so that they do not have a parent
Tree.MoveTo(LNodes[i], nil, amAddChildFirst, False);
But they are simply deleted! How to make it so that the nodes simply do not have a parent?
I believe you need
Tree.MoveTo( LNodes[i], LNodes[0], amInsertBefore, False);