title: Deserializing XML Response using RestSharp
body: <p>I have read through the various questions already posed here regarding this subject and i'm still no closer to solving my problem.</p>
  
  <p>I am trying to Deserialize this xml response:</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt;
     &lt;SubmissionResult&gt;
       &lt;Result&gt;ACCEPTED&lt;/Result&gt;
         &lt;SubmissionID&gt;
           &lt;RefNo&gt;77587-1425386500&lt;/RefNo&gt;
           &lt;Submitted&gt;9&lt;/Submitted&gt;
           &lt;ValidNo&gt;7&lt;/ValidNo&gt;
           &lt;InvalidNo&gt;2&lt;/InvalidNo&gt;
           &lt;InvalidNo_1&gt;08452782055&lt;/InvalidNo_1&gt;
           &lt;InvalidNo_2&gt;01234567890&lt;/InvalidNo_1&gt;
           &lt;TextvID&gt;77587-1425386500&lt;/TextvID&gt;
         &lt;/SubmissionID&gt;
       &lt;Credits&gt;999999&lt;/Credits&gt;
     &lt;/SubmissionResult&gt; 
  </code></pre>
  
  <p>Using these classes:</p>
  
  <pre><code>[XmlRoot ("SubmissionResult")]
  public class SubmissionResult
  {
      [XmlElement ("Result")]
      public string Result { get; set; }
      public SubmissionID SubmissionID { get; set; }
      [XmlElement("Credits")]
      public int Credits { get; set; }
  }
  
  public class SubmissionID
  {
      [XmlElement("RefNo")]    
      public int RefNo { get; set; }
      [XmlElement("Submitted")]    
      public int Submitted { get; set; }
      [XmlElement("ValidNo")]    
      public int ValidNo { get; set; }
      [XmlElement("TextVID")]    
      public string TextVID { get; set; }
  }
  </code></pre>
  
  <p>However I am only ever returning null and 0 values, which I assume are the default.</p>
  
  <p>Here is the code to get the results and hopefully deserialize:</p>
  
  <pre><code>try
  {
      var request = new RestRequest();
      request.RequestFormat = DataFormat.Xml;
      request.Resource = APIURL;
      request.RootElement = "SubmissionResult";
  
      SubmissionResult r = Execute&lt;SubmissionResult&gt;(request);
  }
  
  public static T Execute&lt;T&gt;(RestRequest request) where T : new()
  {
       var client = new RestClient();
           client.BaseUrl = new  Uri("https://www.textvertising.co.uk/_admin/api", UriKind.Absolute);
  
       var response = client.Execute&lt;T&gt;(request);
  
       return response.Data;
  }
  </code></pre>
  
  <p>Many thanks in advance for any help you can provide.</p>
  
  <p>CS</p>