I have a following XML
I think you can go with this simple transform:
When applied to your input (corrected to make it well-formed):
2222
field1
ABC
field2
1111
field1
XYZ
field2
produces:
1111
field1
XYZ
field2
2222
field1
ABC
field2
Explanation: