title: Can XmlSerializer deserialize into a Nullable<int>?
body: <p>This is duplicate of <a href="https://stackoverflow.com/questions/306877/can-xmlserializer-deserialize-into-a-nullableint">Can XmlSerializer deserialize into a Nullable&lt;int&gt;?</a> but I need a solution that neither change xml document nor forces me to implement IXmlSerializable interface. I dont want to implement IXmlSerializable because I have many additional elements beside <code>&lt;number</code>> that get deserialized correctly.</p>
  
  <p>My xml can contain either element <code>&lt;number&gt;4&lt;/number&gt;</code> or <code>&lt;number/&gt;</code></p>
  
  <pre><code>&lt;root&gt;
  ...
  either &lt;number&gt;4&lt;/number&gt; or &lt;number/&gt;
  ... [other elements]
  &lt;/root&gt;
  </code></pre>
  
  <p>Class</p>
  
  <pre><code>public class root
  {
  public int? number {get; set;}
  ...
  }
  </code></pre>
  
  <p>does not work.</p>