title: xslt select a node with transitive dependency
body: <p>While converting xml to csv using xslt i am facing challenge dealing with transitive dependency.
  Below is my xml (simplified):</p>
  
  <pre><code>&lt;root&gt;
      &lt;hold id="H_100"&gt;
          &lt;value1&gt;A&lt;/value1&gt;
      &lt;/hold&gt;
      &lt;hold id="H_200"&gt;
          &lt;value1&gt;B&lt;/value1&gt;
      &lt;/hold&gt;
      &lt;hold id="H_300"&gt;
          &lt;value1&gt;C&lt;/value1&gt;
      &lt;/hold&gt;
      &lt;party id="C_100"&gt;
          &lt;value2&gt;D&lt;/value2&gt;
      &lt;/party&gt;
      &lt;party id="C_200"&gt;
          &lt;value2&gt;E&lt;/value2&gt;
      &lt;/party&gt;
      &lt;party id="C_300"&gt;
          &lt;value2&gt;F&lt;/value2&gt;
      &lt;/party&gt;
      &lt;party id="A_100"&gt;
          &lt;value2&gt;G&lt;/value2&gt;
      &lt;/party&gt;
      &lt;party id="A_300"&gt;
          &lt;value2&gt;H&lt;/value2&gt;
      &lt;/party&gt;
      &lt;relation hid="H100" pid="C_100"/&gt;
      &lt;relation hid="H100" pid="A_100"/&gt;
      &lt;relation hid="H200" pid="C_200"/&gt; 
      &lt;relation hid="H300" pid="A_300"/&gt; 
  &lt;/root&gt;
  </code></pre>
  
  <p>And my expected output is (Party should be considered only when pid starts with A_) :</p>
  
  <pre><code>Hold,Party
  A,G
  B,
  C,H
  </code></pre>
  
  <p>Does anyone know how to do this using xslt??</p>