public void RemoveAllChildren() { if (HasChildNodes) { if (_ownerdocument.OptionUseIdAttribute) { foreach (HtmlNode node in (IEnumerable <HtmlNode>)_childnodes) { _ownerdocument.SetIdForNode(null, node.GetId()); } } _childnodes.Clear(); _outerchanged = true; _innerchanged = true; } }