Hi
Try this code..
string x = "55";
XNamespace aw = "http://m.xyz.com/rss/";
XDocument document = new XDocument(
new XDeclaration("1.0", "utf-8", "yes"), new XElement("rss", new XAttribute(XNamespace.Xmlns + "media", "http://m.xyz.com/rss/"), new XAttribute("version", "2.0"),
new XElement("channel",
new XAttribute("vendor", "ABC"),
new XAttribute("lastpublishdate", DateTime.Now.ToString("dd/MM/yyyy hh:mm"))),
new XElement("title", "Videos"),
new XElement(aw + "thumbnail", new XAttribute("width", x.Trim()), new XAttribute("height", x.Trim()))
)
);
COde Reference ::
http://forums.asp.net/t/1320854.aspx[
^]