public DataTree Encapsulate() { var p = Parent; int ind = -1; if (p != null) { ind = Index; RemoveFromParent(); } var t = new DataTree(); //AddTo(t); t.AddElement(this); if (p != null) { t.AddTo(ind, p); } return(t); }