I need to sum up quantity per pallet number and product(see first node below) .Also sequence number is needed in the right part of palletnumber value based on first appearance in the xml.Results should look like :