How to read specific node from XML column in stored procedure <p>I am pulling data from a variety of tables in a tsql stored procedure and one of the fields is an XML column. Each child node of this XML has 2 subnodes: Question and Answer. </p> <p>The xml structure looks like this:</p> <p><code>&lt;QuestionXML&gt; &lt;QuestionCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; &lt;Questions&gt; &lt;QuestionModel&gt; &lt;Question&gt;Color&lt;/Question&gt; &lt;Answer&gt;Blue&lt;/Answer&gt; &lt;/QuestionModel&gt; &lt;QuestionModel&gt; &lt;Question&gt;Tall&lt;/Question&gt; &lt;Answer&gt;False&lt;/Answer&gt; &lt;/QuestionModel&gt; &lt;/Questions&gt; &lt;/QuestionCollection&gt; &lt;/QuestionXML&gt;</code></p> <p>I need to find the question node whose name matches the string I pass in, and I would like to retrieve the value of its Answer sibling. </p> <p>Part 1: I would like to use the required XML syntax that is the equivalent of: (SELECT Answer FROM Questions Where Question='Color') AS 'COLOR'</p> <p>Part 2: I would like to select my XML value from an XML column that is the result of a nested SELECT statement.</p> <p>( SELECT Answer</p> <p>FROM (SELECT F.QuestionXML FROM XMLTable F WHERE F.PIN = @PIN) </p> <p>Where Question='Color' ) AS 'COLOR'</p> <p>I am unable to get the XML syntax right.</p> <p>If anyone could get the XML syntax correct for me, I think I can get Part 2 working on my own.</p> <p>Thanks</p>