title: Using SQL to query an XML data column
body: <p>I'm having issues querying XML data stored in a SQL Server 2012 database. The node tree I wish to query is in the following format - </p>
  
  <pre><code>&lt;eForm&gt;
     &lt;page id="equalities" visited="true" complete="true"&gt;
        &lt;Belief&gt;
           &lt;item selected="True" value="Christian"&gt;Christian&lt;/item&gt;
           &lt;item selected="False" value="Jewish"&gt;Jewish&lt;/item&gt;
           ...
        &lt;/Belief&gt;
     &lt;/page&gt;
  &lt;/eForm&gt;
  </code></pre>
  
  <p>What I would like to do is return the value attribute of the item node where the selected attribute is equal to true. I've read several tutorials on querying XML in SQL but can't seem to get the code right.</p>
  
  <p>Thanks
  Stu</p>