title: XmlSerializer doesn't fill in values
body: <p>I created classes from a DTD (over XSD and xsd.exe) for my C# project, so I could easily deserialize them into a model class in my code.</p>
  
  <p>This is roughly how I do it:</p>
  
  <pre><code>XmlReaderSettings readerSettings = new XmlReaderSettings();
  readerSettings.DtdProcessing = DtdProcessing.Parse;
  
  XmlReader reader = XmlReader.Create(tipsfile.FullName, readerSettings);
  
  XmlRootAttribute xRoot = new XmlRootAttribute();
  xRoot.ElementName = "Tips";
  xRoot.IsNullable = true;
  
  XmlSerializer serializer = new XmlSerializer(typeof(Tips), xRoot);
  Tips tips = (Tips)serializer.Deserialize(reader);
  
  reader.Close();
  </code></pre>
  
  <p>But, upon inspection of <code>tips</code>, I see that it holds no values at all from the original XML file. Also, I tried setting a breakpoint on the <code>set</code>-Body of a property of <code>Tips</code>, and it is never reached, although I know for sure that it has a value in the original XML file.</p>
  
  <p>Why is the file not correctly deserialized into the class? Is something missing in my code?</p>
  
  <p><strong>Edit:</strong> Here is the Tips.cs file, which was auto-generated from the XSD</p>
  
  <pre><code>using System.Xml.Serialization;
  
  namespace MyNs.Model
  {
      [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
      [System.SerializableAttribute()]
      [System.Diagnostics.DebuggerStepThroughAttribute()]
      [System.ComponentModel.DesignerCategoryAttribute("code")]
      [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://tempuri.org/caravan_1")]
      [System.Xml.Serialization.XmlRootAttribute(Namespace = "http://tempuri.org/caravan_1", IsNullable = false)]
      public partial class Tips
      {
          private Chapter[] chapterField;
  
          [System.Xml.Serialization.XmlElementAttribute("Chapter")]
          public Chapter[] Chapter
          {
              get
              {
                  return this.chapterField;
              }
              set
              {
                  this.chapterField = value;
              }
          }
      }
  
      [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
      [System.SerializableAttribute()]
      [System.Diagnostics.DebuggerStepThroughAttribute()]
      [System.ComponentModel.DesignerCategoryAttribute("code")]
      [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://tempuri.org/caravan_1")]
      [System.Xml.Serialization.XmlRootAttribute(Namespace = "http://tempuri.org/caravan_1", IsNullable = false)]
      public partial class Chapter
      {
          private string headingField;
          private CarType[] carTypesField;
          private Section[] sectionField;
          private string countryField;
          private string languageField;
  
          public string Heading
          {
              get
              {
                  return this.headingField;
              }
              set
              {
                  this.headingField = value;
              }
          }
  
          [System.Xml.Serialization.XmlArrayItemAttribute("CarType", IsNullable = false)]
          public CarType[] CarTypes
          {
              get
              {
                  return this.carTypesField;
              }
              set
              {
                  this.carTypesField = value;
              }
          }
  
          [System.Xml.Serialization.XmlElementAttribute("Section")]
          public Section[] Section
          {
              get
              {
                  return this.sectionField;
              }
              set
              {
                  this.sectionField = value;
              }
          }
  
          [System.Xml.Serialization.XmlAttributeAttribute()]
          public string Country
          {
              get
              {
                  return this.countryField;
              }
              set
              {
                  this.countryField = value;
              }
          }
  
          [System.Xml.Serialization.XmlAttributeAttribute()]
          public string Language
          {
              get
              {
                  return this.languageField;
              }
              set
              {
                  this.languageField = value;
              }
          }
      }
       [... and so on ...]
  </code></pre>
  
  <p>And a sample XML file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE Tips SYSTEM "caravan_1.dtd"&gt;
  &lt;Tips&gt;
      &lt;Chapter Country="dafghagt" Language="de"&gt;
          &lt;Heading&gt;fgagasgargaergarg&lt;/Heading&gt;        
          &lt;Section id="1"&gt;
              &lt;Heading&gt;afdhwr6u5taehtaqh5&lt;/Heading&gt;
              &lt;SubSection id="1"&gt;
                  &lt;Heading&gt;46k46kw6jhadfgadfha&lt;/Heading&gt;              
                  &lt;Table&gt;
                      &lt;Row id="1"&gt;
                          &lt;Heading&gt;sgjsfgjsgfh443q572q356&lt;/Heading&gt;
                          &lt;Items&gt;
                              &lt;Item car="motor1" id="1"&gt;
                                  &lt;BodyText color="red"&gt;130*&lt;/BodyText&gt;
                                  &lt;Subscript&gt;3&lt;/Subscript&gt;
                              &lt;/Item&gt;
                          &lt;/Items&gt;
                      &lt;/Row&gt;
                  &lt;/Table&gt;
              &lt;/SubSection&gt;
          &lt;/Section&gt;
      &lt;/Chapter&gt;
  &lt;/Tips&gt;
  </code></pre>