Below code gives this error message "Specified method is not supported". But here is sample which is same with mine.
FileInfo file = new FileInfo("../../file.xml");
XDocument xfile = XDocument.Load(file.FullName);
XPathNavigator nav = xfile.CreateNavigator();
nav.AppendChild("<pages>100</pages>");