title: C# : Read/Write DateTime from/into XML
body: <p>I need to know the optimal way of writing/reading <code>DateTime</code> into/from XML. Should I directly write <code>DateTime</code> into XML or <code>DateTime.ToString()</code> into XML? </p>
  
  <p>Second question is how to read the date element from XML. Can casting be used for this? Eg:</p>
  
  <p><code>(DateTime)rec.Element("Date").value</code></p>
  
  <p>Or, do I need to parse the string like this? Eg:</p>
  
  <p><code>DateTime.Parse(rec.Element("Date").value)</code></p>