elem = XDoc.CreateElement("sendpost");
XmlText xetxt = XDoc.CreateTextNode(text);
elem.AppendChild(xetxt);
XSession.AppendChild(elem);
XSession.AppendChild(XDoc.CreateElement("sendpost").AppendChild(XDoc.CreateTextNode(resp)));
using System;
using System.Xml;
using System.Xml.Linq;
public class Program
{
public static void Main()
{
string text = "Hello World";
var doc = XDocument.Parse(@"<?xml version=""1.0"" encoding=""utf-8""?><root />");
doc.Root.Add(new XElement("sendpost", text));
Console.WriteLine(doc.ToString());
}
}