title: Append to the last node of xml file c#
body: <p>Each time i get a request from a user, i have to serialize and append it , to an existing xml file like this : </p>
  
  <pre><code>&lt;LogRecords&gt;
    &lt;LogRecord&gt;
      &lt;Message&gt;Some messagge&lt;/Message&gt;
      &lt;SendTime&gt;2017-12-13T22:04:40.1109661+01:00&lt;/SendTime&gt;
      &lt;Sender&gt;Sender&lt;/Sender&gt;
      &lt;Recipient&gt;Name&lt;/Recipient&gt;
    &lt;/LogRecord&gt;
    &lt;LogRecord&gt;
      &lt;Message&gt;Some message too&lt;/Message&gt;
      &lt;SendTime&gt;2017-12-13T22:05:08.5720173+01:00&lt;/SendTime&gt;
      &lt;Sender&gt;sender&lt;/Sender&gt;
      &lt;Recipient&gt;name&lt;/Recipient&gt;
    &lt;/LogRecord&gt;
  &lt;/LogRecords&gt;
  </code></pre>
  
  <p>Currently Serializing data in this way (which works fine):</p>
  
  <pre><code>var stringwriter = new StringWriter();
  var serializer = new XmlSerializer(object.GetType());
  
  serializer.Serialize(stringwriter, object);
  var smsxmlStr = stringwriter.ToString();
  
  var smsRecordDoc = new XmlDocument();
  smsRecordDoc.LoadXml(smsxmlStr);
  
  var smsElement = smsRecordDoc.DocumentElement;
  
  var smsLogFile = new XmlDocument();
  smsLogFile.Load("LogRecords.xml");
  
  var serialize = smsLogFile.CreateElement("LogRecord");
  serialize.InnerXml = smsElement.InnerXml;
  smsLogFile.DocumentElement.AppendChild(serialize);
  
  smsLogFile.Save("LogRecords.xml");
  </code></pre>
  
  <p>And the properties class</p>
  
  <pre><code>[XmlRoot("LogRecords")]
  public class LogRecord
  {
      public string Message { get; set; }
      public DateTime SendTime { get; set; }
      public string Sender { get; set; } 
      public string Recipient { get; set; }
  }
  </code></pre>
  
  <p>But what i want to do is to load the file, navigate to the last element/node of it and append a new <code>List&lt;LogRecord&gt;</code> and save, so i can easily deserialize later. 
  I have tried various ways using XPath Select Methods like <code>SelectSingleNode</code> and  <code>SelectNodes</code> but since i am junior with c# i haven't manage to make them work properly. Does anyone have any idea on how to serialize and append properly? 
  Thank you</p>