Hi, thanks for your reply.
I tried this. It builds an XPath, but the current() function returns the value of a text field AND the SharePoint ID field, like this for the Order with the ShPID 9:
xpath: my:myFields/my:Container/my:Orders/my:Order[Joe Bloggs9]/my:OrderDetails/my:OrderDetail
That's weird.
EDIT: It seems that the fields of the record that get populated will make it into the current() function. I moved a few rules that populate the order group below the Delete command and now the generated Xpath looked like this, which did not work
my:myFields/my:Container/my:Orders/my:Order[9]/my:OrderDetails/my:OrderDetail
But that got me on the right track. After some more tinkering, I got it to work with
concat("Delete /xpath=my:myFields/my:Container/my:Orders/my:Order[my:ShPID = ", current(), "]/my:OrderDetails/my:OrderDetail")
Thank you!!