public void Add(Node <Element> rhs) { if (mOwner.DoesShareHierarchyWith(rhs)) { throw new InvalidOperationException("Cannot add an ancestor or descendant."); } mList.Add(rhs); rhs.Parent = mOwner; }