To modify an XML file with XDocument, you load the file into a variable of type XDocument, modify it in memory, then save it, overwriting the original file.
A common mistake is to modify the XML in memory and expect the file on disk to change.
Given an XML file:
<?xml version="1.0" e...