title: Get XML elements and replace the values as string?
body: <p>Get an XML element from a loaded XML file, I believe I need to modify my logic as I need to get the element value as a string and not Descendants, then replace the value as a custom one and then I need to put the XML as a string message i.e. doc.ToString();</p>
  
  <p>Please advise how to do this to get the elements value as a string from the loaded XML and then replace that value in memory?</p>
  
  <pre><code>string filePath = @"C:\FileMessageTemplates\Outright\"; //File path
  XDocument doc = XDocument.Load(filePath + "First_Test_1.xml"); //Loads document 
  string catsId = doc.Descendants("CatsId").SingleOrDefault().ToString(); //Want to get element CatsId here and then replace the value, then save it as string
  doc.ToString();
  </code></pre>
  
  <p>Here is the XML</p>
  
  <pre><code>&lt;Test xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchemS-instance" xmlns:user="urn:my-scripts" xmlns:msxsl="urn:schemas-microsoft-com:xslt"&gt;
    &lt;FeedTest&gt;
      &lt;ActionId xsi:nil="true" /&gt;
      &lt;ReplyToMessageId&gt;12345&lt;/ReplyToMessageId&gt;
      &lt;Source&gt;PAPER&lt;/Source&gt;
      &lt;Condition /&gt;
      &lt;FixingRate xsi:nil="true" /&gt;
      &lt;CatsId&gt;TAAH20181105X0000579&lt;/CatsId&gt;
    &lt;/FeedTest&gt;
  &lt;/Test&gt;
  </code></pre>