What you want is a database environment, in loco, to work with your app in mode offline and, when you have a connection, sync this data. Right?
Well, as it was not said whether it is a desktop or mobile app, or assume it is using . NET Framework full, that is, a desktop app.
For these cases, exclusively, I recommend using System.Data.Dataset. Dataset is a representation, I remember, of a database. With it you can simulate an entire database, creating tables, making relationship, even controlling transaction.
But the Feature most important in your case is that it already has methods to record and retrieve information in XML. See:
var dataSet = new DataSet();
dataSet.Tables.Add(new DataTable("Tabela1"));
dataSet.WriteXml(@"c:\bancodedados.xml");
Your scenario fits very well to use this guy. It is super easy to implement, and already has features to save and recover local XML data.
However, note that it is not recommended - by me at least - to use this guy in any scenario. In your, specifically, it.
A few months ago I wrote an article discouraging to use for its complexity. Talking about the Dataset and Datatable evils. Worth a look at.
So, I have an application(desktop) where the client will return an object. Ai in the service (wcf) I have to create an xml where this object will be saved. The xml has to be created and saved on the machine, and after it is generated, using a send file to the database. I cannot save in memory, because then I will have several users using this application and send the data to the xml and saving on the server.
– Luciano
@Luciano, do not understand why not keep in memory since XML will be generated in the WCF service. Play XML in Cache and distribute among users. Saving data on application disk is a bad practice.
– Thiago Lunardi