Appending xml document

I want to append the existing XML document with some tags, I wrote the code but its not working . Can you please suggest me to do this.

[SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][SIZE=2] txt = textBox1.Text.ToString();
[/SIZE][SIZE=2][COLOR=#008080]XmlDocument[/COLOR][/SIZE][SIZE=2] xdoc = [/SIZE][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#008080]XmlDocument[/COLOR][/SIZE]SIZE=2;
xdoc.LoadXml(txt);
[/SIZE][SIZE=2][COLOR=#008080]XmlNode[/COLOR][/SIZE][SIZE=2] root = xdoc.DocumentElement;
[/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#008080]XmlElement[/COLOR][/SIZE][SIZE=2] elem = xdoc.CreateElement([/SIZE][SIZE=2][COLOR=#800000]“price”[/COLOR][/SIZE][SIZE=2],[/SIZE][SIZE=2][COLOR=#800000]""[/COLOR][/SIZE][SIZE=2]);
elem.InnerText = [/SIZE][SIZE=2][COLOR=#800000]“19.95”[/COLOR][/SIZE][SIZE=2];[/SIZE][SIZE=2][COLOR=#008000]
[/COLOR][/SIZE][SIZE=2]root.InsertAfter(elem, root.FirstChild);
[/SIZE][SIZE=2]xdoc.Save(txt);

Thanks a lot,
Anjali:jail:
[/SIZE]

Hmm…Thanks Kiripa…
Its done…

Thanks a lot,
Anjali …:angel:

[quote=kirupa;2315552]That is similar to what I am explaining here where I add a Book node, an attribute, and child nodes: http://www.kirupa.com/net/writingXML_pg2.htm

Have you had a chance to look through that?

Thanks,
Kirupa[/quote]