title: Read value in XML Node - T-SQL
body: <p>This is my code.......</p>
  
  <pre><code>DECLARE @XML AS XML;
  
  SET @XML = CAST('&lt;Session id="ID969138672" realTimeID="4300815712"&gt;
  
    &lt;VarValues&gt;
      &lt;varValue id="ID123" source="Internal" name="DisconnectedBy"&gt;VisitorClosedWindow&lt;/varValue&gt;
      &lt;varValue id="ID1234" source="PreChat"  name="email"&gt;1234@mail.ru&lt;/varValue&gt;
    &lt;/VarValues&gt;
  
  &lt;/Session&gt;
  ' AS XML)
  
  SELECT 
   xmlData.Col.value('@id','varchar(max)')
  ,xmlData.Col.value('@source','varchar(max)')
  ,xmlData.Col.value('@name','varchar(max)')
  FROM @XML.nodes('//Session/VarValues/varValue') xmlData(Col);
  </code></pre>
  
  <p>This is the output.....</p>
  
  <p><img src="https://i.stack.imgur.com/gKEPN.png" alt="enter image description here"></p>
  
  <p>How can I include the actual values of the varValue?</p>
  
  <p>I need to read the values <strong>VisistorClosedWindow</strong> and <strong>1234@mail.ru</strong> values as well</p>