Removing nodes from an XmlDocument May 12, 2023 by Tarik Instead of configDoc.RemoveChild(projectNodes[i]); try projectNodes[i].parentNode.RemoveChild(projectNodes[i]);