title: C# XML - getting an optional tag?
body: <p>I have xml with the following:</p>
  <pre><code>     &lt;sample intentref=&quot;BIZ_hello&quot; count=&quot;1&quot;&gt;hey&lt;/sample&gt;
       &lt;sample intentref=&quot;business_status&quot; count=&quot;1&quot;&gt;status of my order&lt;/sample&gt;
       &lt;sample intentref=&quot;business_status&quot; count=&quot;1&quot;&gt;order for my number&lt;annotation conceptref=&quot;o_number&quot;&gt;12343&lt;/annotation&gt;
  </code></pre>
  <p>And I'm trying to build a list like this:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">Intent</th>
  <th style="text-align: left;">Sample</th>
  <th style="text-align: left;">Count</th>
  <th style="text-align: center;">Annotation</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">BIZ_hello</td>
  <td style="text-align: left;">hey</td>
  <td style="text-align: left;">1</td>
  <td style="text-align: center;">NONE</td>
  </tr>
  <tr>
  <td style="text-align: left;">business_status</td>
  <td style="text-align: left;">status of my order</td>
  <td style="text-align: left;">1</td>
  <td style="text-align: center;">NONE</td>
  </tr>
  <tr>
  <td style="text-align: left;">business_status</td>
  <td style="text-align: left;">order for my number</td>
  <td style="text-align: left;">1</td>
  <td style="text-align: center;">&quot;&lt;annotation conceptref=o_number&gt;12343&lt;/annotation&gt;&quot;</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I'm stuck at getting the 'annotated text' part. The code I have so far that works for 'intent' and 'sample' and 'count'...I'm trying to get that optional '' tag .</p>
  <pre class="lang-cs prettyprint-override"><code>XmlDocument xdoc = new XmlDocument();
  xdoc.Load(fileName);
  
  XmlNodeList nodes = xdoc.SelectNodes(&quot;project/samples/sample&quot;);
  
  foreach (XmlNode xn in nodes)
  {
  
      ParseList tempList = new ParseList();
      tempList.intentName = xn.Attributes[&quot;intentref&quot;]?.Value ?? &quot;Unassigned&quot;;
      tempList.sampleSentence = xn.FirstChild.Value;
      tempList.countSamples = xn.Attributes[&quot;count&quot;].Value;
      tempList.annotatedText = ???
  
  }
  </code></pre>