title: What is the significance of [1] in Xquery
body: <p>I am new to xquery in SQL Server.</p>
  
  <p>I have often come across xquery expressions using [1] with attributes.</p>
  
  <p>Can somebody please explain what does it mean?</p>
  
  <p>Here is a example </p>
  
  <pre><code>declare @aa xml
  set @aa='&lt;data&gt;
    &lt;row&gt;
      &lt;Value&gt;1&lt;/Value&gt;
      &lt;Text&gt;Masters&lt;/Text&gt;
    &lt;/row&gt;
    &lt;row&gt;
      &lt;Value&gt;2&lt;/Value&gt;
      &lt;Text&gt;Transactions&lt;/Text&gt;
    &lt;/row&gt;
    &lt;row&gt;
      &lt;Value&gt;3&lt;/Value&gt;
      &lt;Text&gt;Misch. Reports&lt;/Text&gt;
    &lt;/row&gt;
  &lt;/data&gt;'
  
  
  select a.f.value('Value[1]','varchar(50)'),   --  why [1] here ?
     a.f.value('Text[1]','varchar(50)')         --  and here too..
   from @aa.nodes('/data/row') as a(f)
  </code></pre>
  
  <p>Thanks n Regards</p>