I have the following XML LINQ query from my XDocument.
var totals = (from x in MyDocument.Descendants("TOTALS") select x).FirstOrDefault();
Once I have found my totals node I need to add some elements to that node and push that change to the XDocument.
So just make the change to the returned node… unless you clone it, it will still be part of the document.
Btw, your query expression isn’t adding anything – simpler code would be: