DataTable table = new DataTable() { TableName = "Customer" };
DataColumn keyColumn = table.Columns.Add("id", typeof(System.Int32));
table.Columns.Add("ParentId", typeof(System.Int32));
table.Columns.Add("Path", typeof(System.String));
table.coulmn.Add("type",typeof(System.Char));
table.coulmn.Add("Desc", typeof(System.Char));
table.PrimaryKey = new DataColumn[] { keyColumn };
table.AcceptChanges();
string xmlString = string.Empty;
using (TextWriter writer = new StringWriter())
{
table.WriteXml(writer);
xml = writer.ToString();
}