title: how to query all the children nodes for particular attribute
body: <p>I have the following sort of xml structure:</p>
  
  <pre><code>&lt;ObjectTemplate&gt;
   &lt;Sections&gt;
     &lt;Section Name="something" Identifier="something"&gt;
       &lt;Options&gt;
         &lt;Choice text="something"&gt;
           &lt;TextField visibility="private"&gt;
  </code></pre>
  
  <p>It's not always like the above though. It could be a direct field under Section:</p>
  
  <pre><code>&lt;ObjectTemplate&gt;
       &lt;Sections&gt;
         &lt;Section Name="something" Identifier="something"&gt;
            &lt;TextField visiblity="private"&gt;
  </code></pre>
  
  <p>Is there a way for me to query all the children of  node for attribute "visibility"?</p>
  
  <p>I have following working code so far just to extract Section from xml:</p>
  
  <pre><code>select distinct identifier from (
  select 
  T.C.value('@Name', 'nvarchar(max)') as name,
  T.C.value('@Identifier', 'nvarchar(50)') as identifier
  
  from @templatexml tx
  cross apply tx.CurrentTemplateXml.nodes('(ObjectTemplate/Sections/Section)') as T(C)
  ) as temp
  </code></pre>