title: error generating xml document in C#
body: <p>I'm trying to so some serialization using C#, but it throws an exception saying that <code>there was an error generating the xml document</code>. This is where I do the serialization:</p>
  
  <pre><code> public void serialize()
      {
          try
          {
              XmlSerializer ser = new XmlSerializer(typeof(Repository&lt;Student&gt;));
              StreamWriter myWriter = new StreamWriter("stud.xml");
              ser.Serialize(myWriter, rep);
              myWriter.Close();
          }
          catch (Exception e)
          {
              Console.WriteLine("Error " + e.Message);
          }     
  
      }
  </code></pre>
  
  <p>And this is the class I want to serialize:</p>
  
  <pre><code> public class Repository&lt;T&gt; : MyStack&lt;T&gt;
  {
      public int size;
      public int capacity;
      public SLL&lt;T&gt; stud;
  
      public Repository()
      {
          /*
           * Creator for class Repository.
           */
          this.stud = new SLL&lt;T&gt;();
          this.capacity = 20;
          this.size = 0;
      }
  </code></pre>
  
  <p>where <code>MyStack</code> is an interface, and <code>SSL&lt;T&gt;</code> is singly-linked list I have implemented.</p>