I need to figure out a way to append to a XML file instead of overwriting it while recording my "logging events".
As the logging process is running overwriting the file with XDocument.Save(FilePath) function the process gets slower and slower and slowweeeerrrr as the XML file keeps on growing. I realize it's happening because XDocument.Save() function completely wipes and overwrites the XML file every time its executed.
I have an <Event> XElement .
Somewhere within the XDocument I have a <Events> tag that I need to put it under.
How can I "Stream" my Xelement to the right XDocument tag without having to do
Xdocument.Save() which, as mentioned deletes and overwrites the XML file, affecting my program performance.