Another ugly problem. The people who designed this XML format should be repeatedly hit on the head with rotting fish carcasses.
You might do something with the previous-sibling axis to find the previous <Pset name="X_number"> for one of your Pset elements. But really the format should be redesigned so that if there's a natural group of Pset elements, they should be enclosed as children of a higher-level element.