I need my xpath expression to select only the first child element of an xml file based on condition. Say the first having field1=B. I use this expression but it return that with field1=A.
<root>
<entry>
<field1>A</field1>
<field2>10</field2>
</entry>
<entry>
<field1>B</field1>
<field2>20</field2>
</entry>
/root/entry[//field1='B' or 'C'][1]
How can I do it?