Question: how to parse xdocument in c#?
Answer: // Using XML Linq. XDocument xdoc1 = XDocument.Parse(tempXml); var elementsToRemove = from elemet in xdoc1.Elements("Projects").Elements("Project") where elemet.Attribute("Name").Value == "project1" select elemet; foreach (var e in elementsToRemove) { e.Remove();