title: xquery to return the element name
body: <pre><code>DECLARE @XML XML
  SET @xml = '
  &lt;root&gt;
      &lt;a&gt;
          &lt;DATE_OF_BIRTH&gt; 19871224&lt;/DATE_OF_BIRTH&gt; 
          &lt;DRIVER&gt; MIKE &lt;/DRIVER&gt; 
      &lt;/a&gt;
      &lt;a&gt;
          &lt;DATE_OF_BIRTH&gt; 19881124&lt;/DATE_OF_BIRTH&gt; 
          &lt;DRIVER&gt; TOM &lt;/DRIVER&gt; 
      &lt;/a&gt;
      &lt;a&gt;
          &lt;DATE_OF_BIRTH&gt; 19770601&lt;/DATE_OF_BIRTH&gt; 
          &lt;DRIVER&gt; DAVID &lt;/DRIVER&gt; 
      &lt;/a&gt;
  &lt;/root&gt;'
  
  select x.value('.','varchar(100)')
  from @xml.nodes('//a') as T(X)
  </code></pre>
  
  <p>I want to use xquery to return the element name </p>
  
  <p>The result like this </p>
  
  <p>DATE_OF_BIRTH</p>
  
  <p>DRIVER</p>
  
  <p>How can I make this happen? </p>
  
  <p>Thank you very much. </p>