The HL7 message model outputs an eol after every segment and there isn't a way to override it that I'm aware of. So if you let your HL7 message process through to a destination node (or view it in the test logs and caches) you will see the newline at the end.
So if you really want to get rid of the endline you will have to do it from a mapping node using message.getNode("/") and do whatever you want with it at that point.
So in a mapping node if I output to file the endlines will not be added.
qie.writeFile('/tmp/modified.hl7', message.getNode("/"), true);