Empty lines at the end of the payload generated in FTP server

Hi All,
I am facing an issue in one of the use cases that I am trying to implement.
I am getting a purchase order from one of the trading partners through Oracle B2B.
B2B forwards this B2BM (B2B message ) to AIAB2BInterface. From AIAB2BInterface my BPEL process gets invoked, which in turn invokes the AdapterComposite which has a FTP adapter that writes the purchase order to a FTP server. PFB the end to end flow.
PurchaseOrder from ABC trading pertner--> Oracle B2B --> AIAB2BInterface --> TestInputProvABCS --> TestInputAdapter -> Host trading partner picks up the file from FTP location
In the ProvABCS I retrieve the actual payload from the B2BM and convert it into a string using ora:getContentasString. I am then invoking the adapter composite and sending the string as the input to FTP adapter. At the adapter composite I use a simple native schema (for validation of the input string) which has only one element PO_Info of the type string. But when the file gets generated in the FTP server there are empty lines and junk characters at the end of the file.
Need some advice on this. Why are the empty lines coming in the end of the file? Please help!
Thanks

FTP has been known to scramble data in various ways, usually by transferring it as ASCII instead of binary, but adding extra lines to the end is not one of these ways. I suspect one of hte other things in the chain is doing so.