It's perfectly possible to use a MemoryStream instead of a FileStream to "write" data to an FTP server.
From the top of my head: (just a snippet of code, I asume you have the FTP stuff already)
var data = ASCIIEncoding.ASCII.GetBytes(yourXmlString);
using (var dataStream = new MemoryStream(data))
using (var requestStream = ftpRequest.GetRequestStream())
{
contentLength = dataStream.Read(buffer, 0, bufferLength);
while (contentLength != 0)
{
requestStream.Write(buffer,0,bufferLength);
contentLength = dataStream.Read(buffer, 0, bufferLength);
}
}
In other words, you simply need a stream, doesn't matter if it's a FileStream or MemoryStream