Gotten closer to the bug that is resulting in corrupted xml files

Trying to simplify the code that loads the file stream, makes an XDocument instance, finds the corresponding file XElement, replaces them and then saves the file.

It's not working but I need to take a break and eat.