@alan-kilborn no problem :)
i applied a brute force approach and now i hope my xml will work:
step 1) find <relationship and replace with <relationship>FYY ( *
step 2) find source and replace with ) source *
Step 3) find (?-s)(?-i:<relationship>|(?!\A)\G).?\K(?:\x20(.+?)) with identifier=“id-999999”
Step 4) find >FYY and replace with " "
Step 5) find <connection and replace with <connection>FYY
Step 6) find relationshipRef and replace with ( relationshipRef
Step 7) find (?-s)(?-i:<connection>|(?!\A)\G).?\K(?:\x20(.+?)) and replace with relationshipRef=“id-999999”
Step 8) find >FYY and replace with " "
Step 9) find ) source and replace with source
am i mad? :D