title: Parsing XML nodes Key:Value
body: <p>I am trying to parse this example:</p>
  
  <pre><code>declare @xml xml
  
  set @xml = '&lt;SelectedValues&gt;
    &lt;SelectedValue&gt;
      &lt;Name&gt;Brand&lt;/Name&gt;
      &lt;Value&gt;Baume &amp;amp; Mercier&lt;/Value&gt;
    &lt;/SelectedValue&gt;
    &lt;SelectedValue&gt;
      &lt;Name&gt;MPN&lt;/Name&gt;
      &lt;Value&gt;902&lt;/Value&gt;
    &lt;/SelectedValue&gt;
    &lt;SelectedValue&gt;
      &lt;Name&gt;Model&lt;/Name&gt;
      &lt;Value&gt;Baume &amp;amp; Mercier 902&lt;/Value&gt;
    &lt;/SelectedValue&gt;
  &lt;/SelectedValues&gt;'
  
   select c.value('local-name(.)', 'varchar(max)') as 'myKey'
          , c.value('.', 'varchar(max)') as 'myValue' 
  from @xml.nodes('/SelectedValues//*[not(*)]') as T(c) 
  </code></pre>
  
  <p>My desired output should be:</p>
  
  <pre><code>myKey myValue
  Brand Baume &amp; Mercier
  MPN   902
  Model Baume &amp; Mercier 902
  </code></pre>
  
  <p>But instead of that I'm getting this one:</p>
  
  <p><a href="https://i.stack.imgur.com/PGkeF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PGkeF.png" alt="xml"></a></p>
  
  <p>What am I making wrong here?</p>