title: Parsing XML - Value out of range
body: <p>I have a problem, I am trying to list all my tfs projects and I am having this exception:</p>
  
  <blockquote>
    <p>Value does not fall within the expected range.</p>
  </blockquote>
  
  <p>Here is my method</p>
  
  <pre><code>public async  Task&lt;XElement&gt; Deserialize()
  {
      string xml = "https://tfsodata.visualstudio.com/DefaultCollection/Projects('xxxx')/WorkItems";
      var feed = await this.GetAsync(PROJECTS_PATH);
  
      var x = feed.Items.ToString();
      XElement dataTfs = new XElement(x);
      foreach(var tfsdata in feed.Items) 
      {
  
      var xDoc = XDocument.Parse(tfsdata.Content.Text);
      IEnumerable&lt;XElement&gt; elem = xDoc.Elements();
  
      XNamespace m = "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata";
      XNamespace d = "http://schemas.microsoft.com/ado/2007/08/dataservices";
  
      var data =  from query in xDoc.Descendants(m + "properties")
                 select new TfsEntities.Models.TfsEntities.properties
                 {
                     Title = (string)query.Element(d + "Title"),
                     State = (string)query.Element(d + "State"),
                     Reason = (string)query.Element(d + "Reason")
                 };
      dataTfs.Add(data.ToList());
      }
      return (XElement)dataTfs;
  }
  </code></pre>
  
  <p>Does anyone know how to fix this problem please?
  Thank you</p>