```
private void SendXmlFile(XDocument xDocument)
{
var fileName = GenerateFileName();
using (var client = new SftpClient("127.0.0.1", 990, "user01", "us3r01"))
{
client.Connect();
var stream = CreateStream(xDocument);
client.BeginUploadFile(stream, fileName, UploadCompleted);
client.Disconnect();
}
}
```
private void SendXmlFile(XDocument xDocument)
{
var fileName = GenerateFileName();
using (var client = new SftpClient("127.0.0.1", 990, "user01", "us3r01"))
{
client.Connect();
var stream = CreateStream(xDocument);
client.BeginUploadFile(stream, fileName, UploadCompleted);
client.Disconnect();
}
}
```