title: Use XSLT/XPATH to select elements having a child element with a specific value
body: <p>I have a large (200k lines) XML file as a report from a tool (reporting on a VSS database). It consists of a large number of <code>&lt;file&gt;</code> elements like this:</p>
  
  <pre><code>&lt;file&gt;
   &lt;name&gt;file.bat&lt;/name&gt;
   &lt;version&gt;111&lt;/version&gt;
   &lt;checkedout&gt;No&lt;/checkedout&gt;
   &lt;binary&gt;Text&lt;/binary&gt;
   &lt;vss_path&gt;$/Code/file.bat&lt;/vss_path&gt;
   &lt;original_path&gt;C:\code\file.bat&lt;/original_path&gt;
   &lt;action&gt;Labeled &amp;apos;1.2.3.4&amp;apos;&lt;/action&gt;
   &lt;date&gt;27/09/2013 09:08:00&lt;/date&gt;
   &lt;comment&gt;&lt;/comment&gt;
   &lt;label&gt;1.2.3.4&lt;/label&gt;
   &lt;label_comment&gt;&lt;/label_comment&gt;
   &lt;user&gt;John&lt;/user&gt;
   &lt;shared_links&gt;
    &lt;shared_link&gt;$/Beta_1&lt;/shared_link&gt;
    &lt;shared_link&gt;$/Branches/New_Feature&lt;/shared_link&gt;
   &lt;/shared_links&gt;
  &lt;/file&gt;
  </code></pre>
  
  <p>I want to find <em>only</em> the <code>&lt;file&gt;</code> elements which have at least one <code>&lt;shared_link&gt;</code> starting with/prefixed by "$/Beta".</p>
  
  <p>In an ideal world, all I want for each matching element are the <code>&lt;name&gt;</code>, <code>&lt;vss_path&gt;</code> and (matching) <code>&lt;shared_link&gt;</code> parts, but that's not exactly important.</p>
  
  <p>I'm not well-versed in XSLT/XPATH but believe those can do something like this?</p>