I have the following text in xml file:
var doc = XDocument.Load("test.xml");
doc.Root.Element("XCAM").Attribute("LibraryDirectory").Value = "new value";
doc.Save("test.xml");
UPDATE:
doc.Root
.Element("InputFormats")
.Element("XCAM")
.Attribute("LibraryDirectory").Value = "new value";
or using XPATH:
doc.XPathSelectElement("//InputFormats/XCAM")
.Attribute("LibraryDirectory").Value = "new value";
Don't forget to add the using System.Xml.XPath as XPathSelectElement is an extension method.