Plain and simple... to change i.e.
var doc = XDocument.Load([FILENAME]);
doc.Root["Body"]["Monday"]["FiveToNine"] = "What ever";
to add
var myNewElement = new XElement("NodeName", "NodeValue");
doc.Root["Body"]["Monday"].Add(myNewElement);
and save it afterwards...
Maybe you want to take a look at
these pages[
^]
---------------------------
Sorry, mixed up XmlDocument and XDocument....
static void Main(string[] args)
{
var doc = new XmlDocument();
doc.Load(@"MyFile.xml");
Console.WriteLine(doc["MediaPlayer"]["Body"]["Name"].InnerText);
doc["MediaPlayer"]["Body"]["Name"].InnerText = "Something else";
Console.WriteLine(doc["MediaPlayer"]["Body"]["Name"].InnerText);
var newNode = doc.CreateElement("Wednesday");
doc["MediaPlayer"]["Body"].AppendChild(newNode);
Console.WriteLine(doc["MediaPlayer"]["Body"].InnerXml);
Console.WriteLine("Done...");
Console.ReadLine();
}