You can add a Scripted Assertion that accesses LASTRESPONSE or use a JSR-223 step.
In your example, LASTRESPONSE is a reference to the response that has been stored as a result of the REST step execution; therefore, String b = testExec.getStateValue("LASTRESPONSE"); returns a String representation of the XML document.
If the script needs to implement its own XPath logic, you need to add behavior (and import the necessary classes) to convert the string into a DOM object. You also have the standard string manipulation functions (b.indexOf(), b.substring(), etc.) available.
As mentioned, Filters provide an OOTB method for accessing the DOM objects. Similarly, once data is 'filtered', it can be accessed in a script by calling testExec.getStateValue( "filterName" ). where 'filterName' is the name of the filter that was created.