title: Parameterless constructor when using XmlSerializer
body: <p>I'm currently trying to copy (by use of code) a .xml file and have approached it many different ways. This way however seems to be the one I get the most as i have I've it before but to create a console.writeline output. I can't seem to get it to work for a console.out when producing the .xml layout. It gives me the following error </p>
  
  <blockquote>
    <p>"cannot be serialized because it does not have a parameterless constructor"   </p>
  </blockquote>
  
  <p>please could anyone help me with this.</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Xml;
  using System.Xml.Linq;
  using System.Xml.Serialization;
  
  namespace ConsoleApplication1
  {
  class Program
  {
      const string FILENAME = @"SmallResults.xml";
      static void Main(string[] args)
      {
          List&lt;BasicEvent&gt; NewBasicEvent = new List&lt;BasicEvent&gt;();
          XmlTextReader fileReader = new XmlTextReader("SmallResults.xml");
          XmlDocument xml = new XmlDocument();
          xml.Load(fileReader);
          XmlNodeList BasicEvents = xml.SelectNodes("/HiP-HOPS_Results/FaultTrees/FMEA/Component/Events/BasicEvent");
          if (BasicEvents != null)
          {
              XmlNode[] nodearray = BasicEvents.Cast&lt;XmlNode&gt;().ToArray();
              for (int i = 0; i &lt; BasicEvents.Count; i++)
              {
                  NewBasicEvent.Add(new BasicEvent(nodearray[i].FirstChild.NextSibling.InnerText, nodearray[i].FirstChild.NextSibling.NextSibling.InnerText, nodearray[i].FirstChild.NextSibling.NextSibling.InnerText, nodearray[i].FirstChild.NextSibling.NextSibling.NextSibling.InnerText));
                  new XmlSerializer(typeof(BasicEvent)).Serialize(Console.Out, nodearray );
              }
          }
  
  
      }
  }
  public class FMEA
  {
      public List&lt;Component&gt; components { get; set; }
  }
  public class Component
  {
      public string CompName { get; set; }
      public string BasicEventID { get; set; }
      public List&lt;BasicEvent&gt; basicevents { get; set; }
  }
  public class Events
  {
  }
  public class BasicEvent
  {
      public string BasicEventName { get; set; }
      public string BasicEventShortName { get; set; }
      public string BasicEventDescription { get; set; }
      public string BasicEventUnavalability { get; set; }
      public List&lt;Effects&gt; effects { get; set; }
  
      public BasicEvent( string basiceventname, string basiceventshortname, string basiceventdescription, string basiceventunavalability )
      {
          BasicEventName = basiceventname;
          BasicEventShortName = basiceventshortname;
          BasicEventDescription = basiceventdescription;
          BasicEventUnavalability = basiceventdescription;
      }
  </code></pre>