title: How to use xsd in c#?
body: <p>I am new to xml's. I have used xsd.exe to create a .xsd file and a .cs file from an xml.
  But i don't know what or how to access it now?
  I have seen some example but found them confusing.
  Is there a simple tutorial somewhere or an example somebody could give me please?</p>
  
  <pre><code>    //------------------------------------------------------------------------------
  // &lt;auto-generated&gt;
  //     This code was generated by a tool.
  //     Runtime Version:4.0.30319.237
  //
  //     Changes to this file may cause incorrect behavior and will be lost if
  //     the code is regenerated.
  // &lt;/auto-generated&gt;
  //------------------------------------------------------------------------------
  
  using System.Xml.Serialization;
  
  // 
  // This source code was auto-generated by xsd, Version=4.0.30319.1.
  // 
  
  
  /// &lt;remarks/&gt;
  [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
  [System.SerializableAttribute()]
  [System.Diagnostics.DebuggerStepThroughAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
  [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
  public partial class file {
  
      private fileClass[] itemsField;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute("class", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public fileClass[] Items {
          get {
              return this.itemsField;
          }
          set {
              this.itemsField = value;
          }
      }
  }
  
  /// &lt;remarks/&gt;
  [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
  [System.SerializableAttribute()]
  [System.Diagnostics.DebuggerStepThroughAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
  public partial class fileClass {
  
      private string search_keywordsField;
  
      private fileClassPart[] partField;
  
      private string idField;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string search_keywords {
          get {
              return this.search_keywordsField;
          }
          set {
              this.search_keywordsField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute("part", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public fileClassPart[] part {
          get {
              return this.partField;
          }
          set {
              this.partField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public string id {
          get {
              return this.idField;
          }
          set {
              this.idField = value;
          }
      }
  }
  
  /// &lt;remarks/&gt;
  [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
  [System.SerializableAttribute()]
  [System.Diagnostics.DebuggerStepThroughAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
  public partial class fileClassPart {
  
      private string tcpnField;
  
      private string last_change_dateField;
  
      private string primary_part_nbrField;
  
      private string te_part_detail_urlField;
  
      private string part_statusField;
  
      private string product_codeField;
  
      private string gpl_codeField;
  
      private string gpl_descField;
  
      private string lf_comp_descField;
  
      private string lf_process_descField;
  
      private string part_descField;
  
      private fileClassPartImage_urls[] image_urlsField;
  
      private fileClassPartPart_aliasesAlias[][] part_aliasesField;
  
      private fileClassPartAttributesAttr_cat[][] attributesField;
  
      private fileClassPartDocInfoList[] docInfoListField;
  
      private string idField;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string tcpn {
          get {
              return this.tcpnField;
          }
          set {
              this.tcpnField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string last_change_date {
          get {
              return this.last_change_dateField;
          }
          set {
              this.last_change_dateField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string primary_part_nbr {
          get {
              return this.primary_part_nbrField;
          }
          set {
              this.primary_part_nbrField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string te_part_detail_url {
          get {
              return this.te_part_detail_urlField;
          }
          set {
              this.te_part_detail_urlField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string part_status {
          get {
              return this.part_statusField;
          }
          set {
              this.part_statusField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string product_code {
          get {
              return this.product_codeField;
          }
          set {
              this.product_codeField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string gpl_code {
          get {
              return this.gpl_codeField;
          }
          set {
              this.gpl_codeField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string gpl_desc {
          get {
              return this.gpl_descField;
          }
          set {
              this.gpl_descField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string lf_comp_desc {
          get {
              return this.lf_comp_descField;
          }
          set {
              this.lf_comp_descField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string lf_process_desc {
          get {
              return this.lf_process_descField;
          }
          set {
              this.lf_process_descField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string part_desc {
          get {
              return this.part_descField;
          }
          set {
              this.part_descField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute("image_urls", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public fileClassPartImage_urls[] image_urls {
          get {
              return this.image_urlsField;
          }
          set {
              this.image_urlsField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      [System.Xml.Serialization.XmlArrayItemAttribute("alias", typeof(fileClassPartPart_aliasesAlias), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public fileClassPartPart_aliasesAlias[][] part_aliases {
          get {
              return this.part_aliasesField;
          }
          set {
              this.part_aliasesField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      [System.Xml.Serialization.XmlArrayItemAttribute("attr_cat", typeof(fileClassPartAttributesAttr_cat), Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
      public fileClassPartAttributesAttr_cat[][] attributes {
          get {
              return this.attributesField;
          }
          set {
              this.attributesField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute("docInfoList", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public fileClassPartDocInfoList[] docInfoList {
          get {
              return this.docInfoListField;
          }
          set {
              this.docInfoListField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public string id {
          get {
              return this.idField;
          }
          set {
              this.idField = value;
          }
      }
  }
  
  /// &lt;remarks/&gt;
  [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
  [System.SerializableAttribute()]
  [System.Diagnostics.DebuggerStepThroughAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
  public partial class fileClassPartImage_urls {
  
      private string te_primary_image_urlField;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string te_primary_image_url {
          get {
              return this.te_primary_image_urlField;
          }
          set {
              this.te_primary_image_urlField = value;
          }
      }
  }
  
  /// &lt;remarks/&gt;
  [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
  [System.SerializableAttribute()]
  [System.Diagnostics.DebuggerStepThroughAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
  public partial class fileClassPartPart_aliasesAlias {
  
      private string valueField;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlTextAttribute()]
      public string Value {
          get {
              return this.valueField;
          }
          set {
              this.valueField = value;
          }
      }
  }
  
  /// &lt;remarks/&gt;
  [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
  [System.SerializableAttribute()]
  [System.Diagnostics.DebuggerStepThroughAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
  public partial class fileClassPartAttributesAttr_cat {
  
      private fileClassPartAttributesAttr_catAttr_type[] attr_typeField;
  
      private string nameField;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute("attr_type", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public fileClassPartAttributesAttr_catAttr_type[] attr_type {
          get {
              return this.attr_typeField;
          }
          set {
              this.attr_typeField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public string name {
          get {
              return this.nameField;
          }
          set {
              this.nameField = value;
          }
      }
  }
  
  /// &lt;remarks/&gt;
  [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
  [System.SerializableAttribute()]
  [System.Diagnostics.DebuggerStepThroughAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
  public partial class fileClassPartAttributesAttr_catAttr_type {
  
      private fileClassPartAttributesAttr_catAttr_typeAttr_value[] attr_valueField;
  
      private fileClassPartAttributesAttr_catAttr_typeAlt_uom_attr_value[] alt_uom_attr_valueField;
  
      private string idField;
  
      private string nameField;
  
      private string uomField;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute("attr_value", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
      public fileClassPartAttributesAttr_catAttr_typeAttr_value[] attr_value {
          get {
              return this.attr_valueField;
          }
          set {
              this.attr_valueField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute("alt_uom_attr_value", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
      public fileClassPartAttributesAttr_catAttr_typeAlt_uom_attr_value[] alt_uom_attr_value {
          get {
              return this.alt_uom_attr_valueField;
          }
          set {
              this.alt_uom_attr_valueField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public string id {
          get {
              return this.idField;
          }
          set {
              this.idField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public string name {
          get {
              return this.nameField;
          }
          set {
              this.nameField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public string uom {
          get {
              return this.uomField;
          }
          set {
              this.uomField = value;
          }
      }
  }
  
  /// &lt;remarks/&gt;
  [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
  [System.SerializableAttribute()]
  [System.Diagnostics.DebuggerStepThroughAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
  public partial class fileClassPartAttributesAttr_catAttr_typeAttr_value {
  
      private string valueField;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlTextAttribute()]
      public string Value {
          get {
              return this.valueField;
          }
          set {
              this.valueField = value;
          }
      }
  }
  
  /// &lt;remarks/&gt;
  [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
  [System.SerializableAttribute()]
  [System.Diagnostics.DebuggerStepThroughAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
  public partial class fileClassPartAttributesAttr_catAttr_typeAlt_uom_attr_value {
  
      private string idField;
  
      private string nameField;
  
      private string uomField;
  
      private string valueField;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public string id {
          get {
              return this.idField;
          }
          set {
              this.idField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public string name {
          get {
              return this.nameField;
          }
          set {
              this.nameField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public string uom {
          get {
              return this.uomField;
          }
          set {
              this.uomField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlTextAttribute()]
      public string Value {
          get {
              return this.valueField;
          }
          set {
              this.valueField = value;
          }
      }
  }
  
  /// &lt;remarks/&gt;
  [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
  [System.SerializableAttribute()]
  [System.Diagnostics.DebuggerStepThroughAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
  public partial class fileClassPartDocInfoList {
  
      private string isDocCADFilesAvailableField;
  
      private fileClassPartDocInfoListDocInfo[] docInfoField;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string isDocCADFilesAvailable {
          get {
              return this.isDocCADFilesAvailableField;
          }
          set {
              this.isDocCADFilesAvailableField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute("docInfo", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public fileClassPartDocInfoListDocInfo[] docInfo {
          get {
              return this.docInfoField;
          }
          set {
              this.docInfoField = value;
          }
      }
  }
  
  /// &lt;remarks/&gt;
  [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
  [System.SerializableAttribute()]
  [System.Diagnostics.DebuggerStepThroughAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
  public partial class fileClassPartDocInfoListDocInfo {
  
      private string docTypeField;
  
      private string docIdField;
  
      private string docRevisionField;
  
      private string docTitleField;
  
      private string docSubTypeField;
  
      private string docFileNameField;
  
      private string docFormatField;
  
      private string docSizeField;
  
      private string docLangField;
  
      private string docUrlField;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string docType {
          get {
              return this.docTypeField;
          }
          set {
              this.docTypeField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string docId {
          get {
              return this.docIdField;
          }
          set {
              this.docIdField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string docRevision {
          get {
              return this.docRevisionField;
          }
          set {
              this.docRevisionField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string docTitle {
          get {
              return this.docTitleField;
          }
          set {
              this.docTitleField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string docSubType {
          get {
              return this.docSubTypeField;
          }
          set {
              this.docSubTypeField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string docFileName {
          get {
              return this.docFileNameField;
          }
          set {
              this.docFileNameField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string docFormat {
          get {
              return this.docFormatField;
          }
          set {
              this.docFormatField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string docSize {
          get {
              return this.docSizeField;
          }
          set {
              this.docSizeField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string docLang {
          get {
              return this.docLangField;
          }
          set {
              this.docLangField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public string docUrl {
          get {
              return this.docUrlField;
          }
          set {
              this.docUrlField = value;
          }
      }
  }
  </code></pre>