Projects often require for records of a given status code in an array to be processed differently. Rather than loop over every record in the array and test each one individually, it can be more efficient to only loop over useful records. Xpath is a convenient way to filter out records prior to looping.
The attached project shows how to split the following array of records such that only records whose field1 has a value of 'S' are looped:
<?xml version="1.0" encoding="UTF-8"?>
<SimpleXML>
<Rec>
<field1>S</field1>
<field2>asdf</field2>
</Rec>
<Rec>
<field1>C</field1>
<field2>asdf</field2>
</Rec>
<Rec>
<field1>X</field1>
<field2>asdf</field2>
</Rec>
<Rec>
<field1>S</field1>
<field2>asdf</field2>
</Rec>
<Rec>
<field1>M</field1>
<field2>asdf</field2>
</Rec>
</SimpleXML>
To test it, launch in Verify mode on Studio 3.7.x+ and simply post to the configured URL of the HTTP receive. The inputs are hard-coded in the body variable of the HTTP receive activity.