title: What does Object reference not set to an instance of an object.mean
body: <p>We are trying to read information from a separate XML document. </p>
  
  <p>This is the code we have:</p>
  
  <pre><code>'load the XMLTest document containing cars.
      Dim xml As XDocument = XDocument.Load("CreditApp.xml")
  
  
      Dim SSN As String = txtSSN.Text
      'get all car makes that are red.
      Dim query = From xe In xml.Descendants("SSN")
           Where xe.Element("SSN").Value = SSN
                  Select New With {
                      .FName = xe.Element("FName").Value 'Error in code is here
                  }
  
      'loop through query result output results.
      For Each element In query.ToArray
          MessageBox.Show(element.FName)
      Next
  </code></pre>
  
  <p>We are getting the error:</p>
  
  <p>Object reference not set to an instance of an object.</p>
  
  <p>We are not sure what it is refering too.</p>