title: C# deserializer returns null object
body: <p>I've tried to deserialize xml, but it returns null object. 
  Googling, I found that it could be problem with root element, or annotations, so I've tried to change it (XmlType, XmlRoot(ElementName="...") but with no effect.
  I've read several posts at stackoverflow but still didn't find a solution.</p>
  
  <p>My Xml is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;VerificationResult&gt;
    &lt;Result code="0"&gt;TestResult&lt;/Result&gt;
    &lt;Description code="0000"&gt;TestDescription&lt;/Description&gt;
    &lt;SignatureID&gt;TestSignatureID&lt;/SignatureID&gt;
    &lt;SigningTime&gt;2019-02-02T14:16:13.186+01:00&lt;/SigningTime&gt;
    &lt;VerificationTime&gt;2019-02-24T20:48:12Z&lt;/VerificationTime&gt;
    &lt;SigningCertificate certificateType="testcerttype"&gt;
      &lt;Subject&gt;CN=TestCN,OU=TestOU,O=TestO,C=TestC&lt;/Subject&gt;
      &lt;Issuer&gt;CN=Digital Identification CA&lt;/Issuer&gt;
      &lt;Serial&gt;45371416337571480875599671644328045627&lt;/Serial&gt;
      &lt;ValidFrom&gt;2018-08-30T10:48:02Z&lt;/ValidFrom&gt;
      &lt;ValidTo&gt;2021-08-29T10:48:02Z&lt;/ValidTo&gt;
      &lt;Base64Binary&gt;
        base64binaryString
      &lt;/Base64Binary&gt;
    &lt;/SigningCertificate&gt;
    &lt;RevocationInfo&gt;
      &lt;CRL&gt;
        &lt;Issuer&gt;TestIssuer&lt;/Issuer&gt;
        &lt;CRLSerialNumber&gt;9999999&lt;/CRLSerialNumber&gt;
        &lt;CRLThisUpdate&gt;2019-03-24T10:40:51Z&lt;/CRLThisUpdate&gt;
      &lt;/CRL&gt;
    &lt;/RevocationInfo&gt;
  &lt;/VerificationResult&gt;
  </code></pre>
  
  <p>and class:</p>
  
  <pre class="lang-cs prettyprint-override"><code>[XmlRoot("VerificationResult")]
  public class VerResult
  {
      [XmlType("Result")]
      public class Result
      {
          [XmlAttribute(AttributeName = "code")]
          public string Code { get; set; }
  
          [XmlText]
          public string Text { get; set; }
      }
  
      [XmlType("Description")]
      public class Description
      {
          [XmlAttribute(AttributeName = "code")]
          public string Code { get; set; }
  
          [XmlText]
          public string Text { get; set; }
      }
  
      [XmlType("SigningCertificate")]
      public class SigningCertificate
      {
          [XmlElement(ElementName = "Subject")]
          public string Subject { get; set; }
  
          [XmlElement(ElementName = "Issuer")]
          public string Issuer { get; set; }
  
          [XmlElement(ElementName = "Serial")]
          public string Serial { get; set; }
  
          [XmlElement(ElementName = "ValidFrom")]
          public string ValidFrom { get; set; }
  
          [XmlElement(ElementName = "ValidTo")]
          public string ValidTo { get; set; }
  
          [XmlElement(ElementName = "Base64Binary")]
          public string Base64Binary { get; set; }
  
          [XmlAttribute(AttributeName = "certificateType")]
          public string CertificateType { get; set; }
      }
  
      [XmlType("CRL")]
      public class CRL
      {
          [XmlElement(ElementName = "Issuer")]
          public string Issuer { get; set; }
  
          [XmlElement(ElementName = "CRLSerialNumber")]
          public string CRLSerialNumber { get; set; }
  
          [XmlElement(ElementName = "CRLThisUpdate")]
          public string CRLThisUpdate { get; set; }
      }
  
      [XmlType("RevocationInfo")]
      public class RevocationInfo
      {
          [XmlElement(ElementName = "CRL")]
          public CRL CRL { get; set; }
      }
  
      [XmlType("VerificationResult")]
      public class VerificationResult
      {
          [XmlElement(ElementName = "Result")]
          public Result Result { get; set; }
  
          [XmlElement(ElementName = "Description")]
          public Description Description { get; set; }
  
          [XmlElement(ElementName = "SignatureID")]
          public string SignatureID { get; set; }
  
          [XmlElement(ElementName = "SigningTime")]
          public string SigningTime { get; set; }
  
          [XmlElement(ElementName = "VerificationTime")]
          public string VerificationTime { get; set; }
  
          [XmlElement(ElementName = "SigningCertificate")]
          public SigningCertificate SigningCertificate { get; set; }
  
          [XmlElement(ElementName = "RevocationInfo")]
          public RevocationInfo RevocationInfo { get; set; }
      }
  }
  </code></pre>
  
  <p>Below deserializer returns null object.</p>
  
  <pre><code> public T Deserialize&lt;T&gt;(string input) where T : class
   {
       System.Xml.Serialization.XmlSerializer ser = new System.Xml.Serialization.XmlSerializer(typeof(T));
  
        using (StringReader sr = new StringReader(input))
        {
            return (T)ser.Deserialize(sr);
        }
    }
  </code></pre>