title: How do i make XML from a List?
body: <p>Assume i have the class </p>
  
  <pre><code>public class Test1
  {
      public int BINID { get; set; }
      public int NUMBER1 { get; set; }
      public decimal HOLGRAPHIC { get; set; }
  
      public Test1(int id, int num, decimal hol)
      {
          BINID = id;
          NUMBER1 = num;
          HOLGRAPHIC = hol;
      }
  }
  </code></pre>
  
  <p>Assume i have created a List collection of Test1 in another class called <code>Test2</code>. In <code>Test2</code> class i have created the collection t of <code>Test1</code>.</p>
  
  <pre><code>List&lt;Test1&gt; t = new List&lt;Test1&gt;();
  </code></pre>
  
  <p>Assume this List contains two <code>Test1</code> objects. How do i convert the List to <code>XML</code> to have the following schema?</p>
  
  <pre><code>&lt;t&gt;
  &lt;Test1&gt;
    &lt;BINID&gt;23&lt;/BINID&gt;
    &lt;NUMBER1&gt;123&lt;/NUMBER1&gt;
    &lt;HOLOGRAPHIC&gt;2345.12&lt;/HOLOGRAPHIC&gt;
  &lt;/Test1&gt;
  &lt;Test1&gt;
    &lt;BINID&gt;3&lt;/BINID&gt;
    &lt;NUMBER1&gt;346233&lt;/NUMBER1&gt;
    &lt;HOLOGRAPHIC&gt;12.345&lt;/HOLOGRAPHIC&gt;
  &lt;/Test1&gt;
  &lt;/t&gt;
  </code></pre>