First of all, there is nothing wrong with the linefeed DataPower emits after xml-declaration.
Any system not being capable to deal with that and requiring <?xml version="1.0" encoding="UTF-8"?><… is not XML spec compliant.
This can be fixed in DataPower with a xformbin action, but today's posting is on how to do this easily with GatewayScript.
The task is to remove just the very first linefeed (after xml declaration) and send the modified stuff to output directly.
Here you can see that it works:
$ coproc2 xml.js lx.xml http://quicksilver:2227
<?xml version="1.0" encoding="UTF-8"?><l>
1
</l>
$
$ cat lx.xml; echo
<?xml version="1.0" encoding="UTF-8"?>
<l>
1
</l>
$
And this is the small GatewayScript xml.js doing the job:
Hermann.