title: Getting a foreach to run once
body: <p>So the question is this, I have a for each loop that I am currently using to retrieve data from a query of an XML file which then gets put into a string; like so:</p>
  
  <pre><code>foreach (var value in dateQuery)
                  date = value.Element("HistoryCreation").Value;
  </code></pre>
  
  <p>I know for a fact (Based on the way the xml file stores values and the query being used) that there will only be one value in dateQuery.</p>
  
  <p>Thus, I would like to know (for the purposes of making my program more efficient and learning how to code better), is there a better way to do this or are foreach's the only way?</p>