title: How to show a subset of data based on an element's value's attribute
body: <p>So I have the following XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
  &lt;couriersystem title="System"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="schema.xsd"&gt;
      &lt;!-- snip --&gt;
      &lt;employees&gt;
          &lt;employee eid="1"&gt;
              &lt;nin&gt;AZ123518D&lt;/nin&gt;
              &lt;firstname&gt;Peter&lt;/firstname&gt;
              &lt;lastname&gt;Smith&lt;/lastname&gt;
              &lt;gender&gt;Male&lt;/gender&gt;
              &lt;dob&gt;1994-02-11&lt;/dob&gt;
              &lt;email&gt;ps11@gmail.com&lt;/email&gt;
              &lt;address&gt;
                  119, London Street, Nidrie, F57 8NE
              &lt;/address&gt;
              &lt;tel&gt;07005748900&lt;/tel&gt;
              &lt;salary&gt;30526&lt;/salary&gt;
              &lt;empbranch bid="1" /&gt;
              &lt;supervisor sid="1" /&gt;
          &lt;/employee&gt;
          &lt;employee eid="2"&gt;
              &lt;nin&gt;CN174869F&lt;/nin&gt;
              &lt;firstname&gt;Jennifer&lt;/firstname&gt;
              &lt;lastname&gt;Black&lt;/lastname&gt;
              &lt;gender&gt;Male&lt;/gender&gt;
              &lt;dob&gt;1984-12-24&lt;/dob&gt;
              &lt;email&gt;jb21@gmail.com&lt;/email&gt;
              &lt;address&gt;
                  161, South Road, Nidrie, W79 8WG
              &lt;/address&gt;
              &lt;tel&gt;07555111222&lt;/tel&gt;
              &lt;salary&gt;40576&lt;/salary&gt;
              &lt;empbranch bid="2" /&gt;
              &lt;supervisor sid="1" /&gt;
          &lt;/employee&gt;
          &lt;employee eid="3"&gt;
              &lt;nin&gt;ET127654M&lt;/nin&gt;
              &lt;firstname&gt;Aaron&lt;/firstname&gt;
              &lt;lastname&gt;Jones&lt;/lastname&gt;
              &lt;gender&gt;Male&lt;/gender&gt;
              &lt;dob&gt;1968-03-15&lt;/dob&gt;
              &lt;email&gt;aj31@gmail.com&lt;/email&gt;
              &lt;address&gt;
                  66, High Road, Yoker, Q47 4SR
              &lt;/address&gt;
              &lt;tel&gt;07856471267&lt;/tel&gt;
              &lt;salary&gt;30526&lt;/salary&gt;
              &lt;empbranch bid="3" /&gt;
              &lt;supervisor sid="1" /&gt;
          &lt;/employee&gt;
          &lt;employee eid="4"&gt;
              &lt;nin&gt;GC765238A&lt;/nin&gt;
              &lt;firstname&gt;Alistair&lt;/firstname&gt;
              &lt;lastname&gt;Smith&lt;/lastname&gt;
              &lt;gender&gt;Male&lt;/gender&gt;
              &lt;dob&gt;1976-11-26&lt;/dob&gt;
              &lt;email&gt;as11@gmail.com&lt;/email&gt;
              &lt;address&gt;
                  109, West Plaza, Clydebank, G55 8RC
              &lt;/address&gt;
              &lt;tel&gt;07000123123&lt;/tel&gt;
              &lt;salary&gt;25400&lt;/salary&gt;
              &lt;empbranch bid="4" /&gt;
              &lt;supervisor sid="1" /&gt;
          &lt;/employee&gt;
          &lt;employee eid="5"&gt;
              &lt;nin&gt;HP146854D&lt;/nin&gt;
              &lt;firstname&gt;Emma&lt;/firstname&gt;
              &lt;lastname&gt;Reynolds&lt;/lastname&gt;
              &lt;gender&gt;Male&lt;/gender&gt;
              &lt;dob&gt;1995-05-05&lt;/dob&gt;
              &lt;email&gt;er11@yahoo.com&lt;/email&gt;
              &lt;address&gt;
                  57, Scott Street, Aberdeen, O75 2KS
              &lt;/address&gt;
              &lt;tel&gt;07625361536&lt;/tel&gt;
              &lt;salary&gt;25400&lt;/salary&gt;
              &lt;empbranch bid="5" /&gt;
              &lt;supervisor sid="7" /&gt;
          &lt;/employee&gt;
          &lt;employee eid="6"&gt;
              &lt;nin&gt;JA213465F&lt;/nin&gt;
              &lt;firstname&gt;Taylor&lt;/firstname&gt;
              &lt;lastname&gt;Smith&lt;/lastname&gt;
              &lt;gender&gt;Male&lt;/gender&gt;
              &lt;dob&gt;1983-08-25&lt;/dob&gt;
              &lt;email&gt;taysmith@hotmail.co.uk&lt;/email&gt;
              &lt;address&gt;
                  6, West Place, Perth, F65 9LK
              &lt;/address&gt;
              &lt;tel&gt;07765665123&lt;/tel&gt;
              &lt;salary&gt;26940&lt;/salary&gt;
              &lt;empbranch bid="6" /&gt;
              &lt;supervisor sid="7" /&gt;
          &lt;/employee&gt;
          &lt;employee eid="7"&gt;
              &lt;nin&gt;PH173957M&lt;/nin&gt;
              &lt;firstname&gt;Jamie&lt;/firstname&gt;
              &lt;lastname&gt;White&lt;/lastname&gt;
              &lt;gender&gt;Male&lt;/gender&gt;
              &lt;dob&gt;1992-07-17&lt;/dob&gt;
              &lt;email&gt;jw21@gmail.com&lt;/email&gt;
              &lt;address&gt;
                  85, West Street, BathgateGlasgow, W1 6KH
              &lt;/address&gt;
              &lt;tel&gt;07649284671&lt;/tel&gt;
              &lt;salary&gt;26940&lt;/salary&gt;
              &lt;empbranch bid="7" /&gt;
              &lt;supervisor sid="1" /&gt;
          &lt;/employee&gt;
          &lt;employee eid="8"&gt;
              &lt;nin&gt;RG185656A&lt;/nin&gt;
              &lt;firstname&gt;Oliver&lt;/firstname&gt;
              &lt;lastname&gt;Jack&lt;/lastname&gt;
              &lt;gender&gt;Male&lt;/gender&gt;
              &lt;dob&gt;1990-09-09&lt;/dob&gt;
              &lt;email&gt;oj21@hotmail.com&lt;/email&gt;
              &lt;address&gt;
                  173, London Street, Edinburgh, V66 5BI
              &lt;/address&gt;
              &lt;tel&gt;07987612635&lt;/tel&gt;
              &lt;salary&gt;26940&lt;/salary&gt;
              &lt;empbranch bid="8" /&gt;
              &lt;supervisor sid="1" /&gt;
          &lt;/employee&gt;
          &lt;employee eid="9"&gt;
              &lt;nin&gt;TE199927D&lt;/nin&gt;
              &lt;firstname&gt;Nicole&lt;/firstname&gt;
              &lt;lastname&gt;Summers&lt;/lastname&gt;
              &lt;gender&gt;Male&lt;/gender&gt;
              &lt;dob&gt;1988-01-12&lt;/dob&gt;
              &lt;email&gt;ns31@gmail.com&lt;/email&gt;
              &lt;address&gt;
                  104, North Lane, Perth, J3 7WP
              &lt;/address&gt;
              &lt;tel&gt;07998812671&lt;/tel&gt;
              &lt;salary&gt;26940&lt;/salary&gt;
              &lt;empbranch bid="9" /&gt;
              &lt;supervisor sid="7" /&gt;
          &lt;/employee&gt;
          &lt;employee eid="10"&gt;
              &lt;nin&gt;WC333245F&lt;/nin&gt;
              &lt;firstname&gt;Barney&lt;/firstname&gt;
              &lt;lastname&gt;Brown&lt;/lastname&gt;
              &lt;gender&gt;Male&lt;/gender&gt;
              &lt;dob&gt;1990-10-10&lt;/dob&gt;
              &lt;email&gt;bb31@yahoo.com&lt;/email&gt;
              &lt;address&gt;
                  173, London Street, Edinburgh, V66 5BI
              &lt;/address&gt;
              &lt;tel&gt;07111346572&lt;/tel&gt;
              &lt;salary&gt;25400&lt;/salary&gt;
              &lt;empbranch bid="1" /&gt;
              &lt;supervisor sid="1" /&gt;
          &lt;/employee&gt;
      &lt;/employees&gt;
      &lt;!-- snip --&gt;
  &lt;/couriersystem&gt;
  </code></pre>
  
  <p>And I want to get all employees by a specific <code>supervisor</code> <code>sid</code>.</p>
  
  <p>So far I've tried this XPath:</p>
  
  <p><code>//*[@sid='1']</code></p>
  
  <p>But this gives me this result, when I want to get all the employees:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;result&gt;
  &lt;supervisor sid="1"/&gt;
  &lt;supervisor sid="1"/&gt;
  &lt;supervisor sid="1"/&gt;
  &lt;supervisor sid="1"/&gt;
  &lt;supervisor sid="1"/&gt;
  &lt;supervisor sid="1"/&gt;
  &lt;supervisor sid="1"/&gt;
  &lt;/result&gt;
  </code></pre>