I have the following xml file:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:doTransactionResponse xmlns:ns2="http://soap.api.controller.web.payjar.com/">
<return>
<displayMessage>An error occurred with this payment, please contact your merchant (ref: P022)</displayMessage>
<merchantReference>mercRef_1350047403</merchantReference>
<payUReference>11999149347</payUReference>
<pointOfFailure>PAYU</pointOfFailure>
<resultCode>P022</resultCode>
<resultMessage>Transaction is not in the correct state - last transaction: FINALIZE state: SUCCESSFUL</resultMessage>
<successful>false</successful>
</return>
</ns2:doTransactionResponse>
</soap:Body>
</soap:Envelope>
I need to test the result code in the xml file against a series of codes. How would I get the specific element value of <resultCode>
using PHP?