I am making some validations in an xml and remove certain elements based on date fields the below LINQ will do the job just fine.
XDocument newXML = XDocument.Load(new StringReader(xmlValue));
var q = from node in newXML.Descendants("Date") let attr = node.Value
where attr != null && DateTime.ParseExact (attr, "dd-MM-yyyy", CultureInfo.InvariantCulture)
< DateTime.Today select node.Parent;
q.ToList().ForEach(x => x.Remove());
How can I check whether this linq has identified and removed the items? ORHow can I load the results of newXML as an xml document?