title: xpath - if else structure
body: <p>i am experimenting with xpath. </p>
  
  <p>Here is the xml I am using for experimenting:</p>
  
  <pre><code>&lt;moves&gt;
      &lt;roll player="1"&gt;6&lt;/roll&gt;
      &lt;piece nr="1" player="1" field="1"/&gt;
      &lt;roll player="2"&gt;4&lt;/roll&gt;
      &lt;roll player="2"&gt;6&lt;/roll&gt;
      &lt;piece nr="5" player="2" field="11"/&gt;
      &lt;roll player="1"&gt;4&lt;/roll&gt;
      &lt;piece nr="1" player="1" field="5"/&gt;
      &lt;roll player="2"&gt;6&lt;/roll&gt;
      &lt;piece nr="5" player="2" field="17"/&gt;
      &lt;roll player="1"&gt;6&lt;/roll&gt;
      &lt;piece nr="2" player="1" field="1"/&gt;
      &lt;roll player="2"&gt;6&lt;/roll&gt;
      &lt;piece nr="6" player="2" field="11"/&gt;
  &lt;/moves&gt;
  </code></pre>
  
  <p>So how to implement an if else in xpath?</p>
  
  <p>Like if the second action is from player one, then do f.ex.: give it back...</p>
  
  <p><strong>UPDATE 1:</strong></p>
  
  <p>Ok here is what i mean:</p>
  
  <pre><code>boolean(/game/moves/roll[2]/@player=1
  </code></pre>
  
  <p>That gives me back if the second element is player 1 or not ,so now I want to add an else-Path like if it would be? So how to add that?</p>