title: How to get specific element Count in XML variable
body: <p>Consider this XML:</p>
  
  <pre><code>&lt;Employees&gt;
      &lt;Person&gt;
          &lt;ID&gt;1000&lt;/ID&gt;
          &lt;Name&gt;Nima&lt;/Name&gt;
          &lt;LName&gt;Agha&lt;/LName&gt;
      &lt;/Person&gt;
      &lt;Person&gt;
          &lt;ID&gt;1001&lt;/ID&gt;
          &lt;Name&gt;Ligha&lt;/Name&gt;
          &lt;LName&gt;Ligha&lt;/LName&gt;
      &lt;/Person&gt;
      &lt;Person&gt;
          &lt;ID&gt;1002&lt;/ID&gt;
          &lt;Name&gt;Jigha&lt;/Name&gt;
          &lt;LName&gt;Jigha&lt;/LName&gt;
      &lt;/Person&gt;
      &lt;Person&gt;
          &lt;ID&gt;1003&lt;/ID&gt;
          &lt;Name&gt;Aba&lt;/Name&gt;
          &lt;LName&gt;Aba&lt;/LName&gt;
      &lt;/Person&gt;
  &lt;/Employees&gt;
  </code></pre>
  
  <p>I declare a <code>XML</code> variable and assign this XML to that. How I can get count of <code>ID</code> elements in this XML variable using Sql Server 2008 (TSQL)?</p>