title: Which of these class level attributes generated by using XSD.exe can be discarded safely?
body: <p>I used <kbd>XSD.exe</kbd> against an XML schema file (<code>.XSD</code>) to generate C# classes for use in deserializing XML data files that conform to the said XML schema.</p>
  
  <p>I noticed the following class level attributes have been added to all the generated classes.</p>
  
  <pre><code>[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.17929")]
  [System.SerializableAttribute()]
  [System.Diagnostics.DebuggerStepThroughAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
  </code></pre>
  
  <p>In some cases, the tool has also generated the <code>XmlElementAttribute</code> attribute, which I am well aware is necessary for proper deserialization.</p>
  
  <pre><code>[System.Xml.Serialization.XmlElementAttribute("Field")]
  </code></pre>
  
  <p>So other than this <code>XmlElementAttribute</code>, which of the aforementioned attributes are really required for deserialization to be successful. I know I can remove them 1 by 1 and try it out, but there are a lot of classes and I want to keep my class definitions as 'clean' as possible without having un-necessary attributes all over the place.</p>
  
  <p>Here's a sample class definition generated by <kbd>XSD.exe</kbd>, in case you need to look at the class also.</p>
  
  <pre><code>[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.17929")]
  [System.SerializableAttribute()]
  [System.Diagnostics.DebuggerStepThroughAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
  public partial class CrystalReportReportFooter {
  
      private CrystalReportReportFooterSection sectionField;
  
      /// &lt;remarks/&gt;
      public CrystalReportReportFooterSection Section {
          get {
              return this.sectionField;
          }
          set {
              this.sectionField = value;
          }
      }
  }
  </code></pre>
  
  <p>Thank you, </p>