in my application (c# 3.5) there are various processes accessing a single xml file (read and write) very frequently. the code accessing the file is placed in an assembly referenced by quite a couple of other applications. for example a windows service might instanciate the MyFileReaderWriter class (locatied in the previously mentioned assembly) and use the read/write methods of this class.
i'm looking for the best/fastest way to read and create/append the file with the least amount of locking. caching the files data and flushing new content periodically is not an option, since the data is critical.
I forgot to mention that I currently use the XDocument (LInq2Xml infrastructure) for reading/writing the content to the file.