title: getting exception while trying to query xdocument
body: <p>I am trying to extract the data from Web response having XML format using the below code 
  but I am getting null reference exception here at this line  <strong>var status = html.Element("Status");</strong></p>
  
  <pre><code>if (oHttpWebResponse.StatusCode.ToString().ToLower() == "ok")
      {
          string contentType = oHttpWebResponse.ContentType;
          Stream content = oHttpWebResponse.GetResponseStream();
          XDocument xDoc = new XDocument(XDocument.Load(content));
          var html = xDoc.Root.Element("html");
          var status = html.Element("Status"); // getting System.NullReferenceException here 
         var statusValue = status.Value;
          var lice = html.Element("LicenseKey").Value;
  
      }
  </code></pre>
  
  <p>I am not why i am getting this error and xml format looks like this ..</p>
  
  <pre><code>&lt;html&gt;
  &lt;Status&gt;
  200
  &lt;/Status&gt;
  &lt;LicenseKey&gt;
  FXOZ-HTTEKG-3QYB-MP2NPQ-AC7I3C-76SX-DVN4BA-C55RMK-RV2P-O5NSOQ
  &lt;/LicenseKey&gt;
  &lt;CustomerId&gt;
  U2N3XCAV
  &lt;/CustomerId&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I am not sure why i am getting this error, If any one please help on this query that would be very grateful to me ..</p>
  
  <p>Thanks in advance..</p>