I am updating a Component using Core Service in Tridion 2011.
The sample code is as follows,
string COMPONENT_URI = \"tcm:8-674\";
string SCHEMA_URI
Your code attempts to save the XML DOM to a file.
XDocument.Save(string fileName) - Serialize this XDocument to a file, overwriting an existing file, if it exists.
You should use something like this:
using (var client = new SessionAwareCoreServiceClient(netTcpBinding, remoteAddress))
{
ReadOptions readOptions = new ReadOptions();
ComponentData component = client.Read(compTcmUri, readOptions) as ComponentData;
XDocument dom = XDocument.Parse(component.Content);
// do your modifications to dom
component.Content = dom.ToString();
component = client.Update(component, readOptions) as ComponentData;
Console.WriteLine("Component updated: " + component.LocationInfo.WebDavUrl);
}