I have added a method called TransformToX12 on the X12Parser class so that you can modify your xml and turn it back into X12.
I had to update the parser to add the delimiters to the xml so that it could be picked up on the transformation back.
See unit test ParseAndTransformToX12 for syntax.
It should be available in changeset 8796.
I will do a release by the end of the month with this change.
If you think the UnbundleByLoop method is not behaving as expected, you are welcome to shoot me an example to troubleshoot.