title: How to get the value of an XML element using Linq even when empty
body: <p>Please excuse my stupidity, I tend to find the traversing XML overly complicated.</p>
  
  <p>I am using ASP.NET in VB.</p>
  
  <p>I have an XML document which contains all the details of staff in my company...</p>
  
  <pre><code>&lt;staff&gt;
      &lt;staffName&gt;Test Staff&lt;/staffName&gt;
      &lt;staffTitle&gt;Slave&lt;/staffTitle&gt;
      &lt;staffDepartmentName&gt;Finance&lt;/staffDepartmentName&gt;
      &lt;staffOffice&gt;London&lt;/staffOffice&gt;
      &lt;staffEmail&gt;t.staff@company.co.uk&lt;/staffEmail&gt;
      &lt;staffPhone&gt;0207 123 456&lt;/staffPhone&gt;
      &lt;staffNotes&gt;Working hours Mon to Thurs 9.15 - 5.15&lt;/staffNotes&gt;
      &lt;staffBio&gt;&lt;/staffBio&gt;
  &lt;/staff&gt;
  </code></pre>
  
  <p>As you can see, some nodes do not always contain data for ever member of staff; only Directors have biographies.</p>
  
  <p>I access the values like this...</p>
  
  <pre><code>For Each staff In ( _
      From matches In myXMLFile.Descendants("staff").Descendants("staffName") _
          Where matches.Nodes(0).ToString.ToLower.Contains(LCase(search)) _
          Order By matches.Value _
          Select matches)
      staffName = staff.Descendants("staffName").Nodes(0).ToString)
      staffTitle = staff.Descendants("staffTitle").Nodes(0).ToString)
      staffOffice = staff.Descendants("staffOffice").Nodes(0).ToString)
      staffEmail = staff.Descendants("staffEmail").Nodes(0).ToString)
      staffPhone = staff.Descendants("staffPhone").Nodes(0).ToString)
      staffNotes = staff.Descendants("staffNotes").Nodes(0).ToString)
      staffBio = staff.Descendants("staffBio").Nodes(0).ToString)
  
      ' Do something with that data...
  Next
  </code></pre>
  
  <p>Once it gets to staffBio I get an error saying "Object reference not set to an instance of an object." obviously because that node does not exist.</p>
  
  <p>My question is how can I assign the value to a variable even when it is empty without having to do a conditional check before each assignment?</p>