title: Use of If/else statement in Xpath 2.0 in WSO2
body: <p>I am using XPATH 2.0 in WSO2 Developer studio to perform some transformations on data in Payload Mediator. In one transformation i have to check that if an element exists in the legacy service response then print 'Yes,it does' otherwise 'No,it don't'.</p>
  
  <p>I am using the following syntax. </p>
  
  <pre><code>if(fn:exists(//*/*[local-name()='HomePhone'])) then fn:concat('Yes','it does') 
  
  else fn:concat('No','it dont')
  </code></pre>
  
  <p>It is giving me following error message. 
  <img src="https://i.stack.imgur.com/vQfEp.png" alt="Error Message"></p>
  
  <p>I am confused about syntax. What's the correct way of using If/else in Xpath 2.0 in my particular scenario? </p>
  
  <p>Note: "fn:concat" function works fine on it's own. </p>