issue removing a XDocument node based on its attribute
问题 I'm trying to remove a CreditCard node in a XDocument called doc based on its name attribute but its not working as intended. doc is my XDocument and it looks like this: XDocument doc = new XDocument( new XComment("XML test file"), new XElement("CreditCards", new XElement("CreditCard", new XAttribute("Name", "TestCard1"), new XAttribute("phoneNumber", 121212142121)), new XElement("CreditCard", new XAttribute("Name", "TestCard2"), new XAttribute("phoneNumber", 6541465561)), new XElement(