xml2Json() can be used to convert the API response from XML to JSON. Then, we can retrieve the values from the JSON string.
Sample Code:
let XMLToJSONResponse = xml2Json( responseBody );
pm.environment.set( “Id”, XMLToJSONResponse[ “CUSTOMER” ][ “ID” ] );
pm.environment.set( “FirstName”, XMLToJSONResponse[ “CUSTOMER” ][ “FIRSTNAME” ] );
pm.environment.set( “LastName”, XMLToJSONResponse[ “CUSTOMER” ][ “LASTNAME” ] );