Hello Uma,
You can convert the IDOC to XML with the help of function module IDOC_XML_TRANSFORM copy by referring to the below document.
Conversion of IDoc to XML File (Handy Tool) - Process Integration - SCN Wiki
For connecting to FTP server and transferring files. use the below function modules in sequence.
HTTP_SCRAMBLE
FTP_CONNECT
FTP_R3_TO_SERVER
FTP_DISCONNECT
Refer to (Source Code for Uploading a text file to an FTP Server based on DATA from the SAP System[FrontEnd]) the below link for the same.
The SAPFTP Library - FTP Programming in ABAP - ABAP Development - SCN Wiki
Regards,
Thanga