title: I want to save an existing List<T> into an XML file in c#
body: <p>I had a place class define as follow:</p>
  
  <pre><code>    public class place
      {
              public string placeID { get; set; }
              public string placeCatID { get; set; }
              public string placeName { get; set; }
      }
  </code></pre>
  
  <p>And the data store in a list call placelist</p>
  
  <pre><code>    List&lt;place&gt; placelist = new List&lt;place&gt;();
  </code></pre>
  
  <p>Can guide me how to convert the placelist to a string or export it and save it into an XML file format as follow:</p>
  
  <pre><code>    &lt;place&gt;
              &lt;pID&gt;0001&lt;/pID&gt;
              &lt;pCatID&gt;C1&lt;/pID&gt;
              &lt;pName&gt;Location 1&lt;/pName&gt;
      &lt;/place&gt;
      &lt;place&gt;
              &lt;pID&gt;0002&lt;/pID&gt;
              &lt;pCatID&gt;C1&lt;/pID&gt;
              &lt;pName&gt;Location 2&lt;/pName&gt;
      &lt;/place&gt;
  </code></pre>
  
  <p>Language using is C#</p>
  
  <p>Thanks.</p>