try
{
using (StreamReader sr = new StreamReader(fileurl))
{
XmlDocument doc = new XmlDocument();
doc.Load(sr);
}
XmlNode root = doc.DocumentElement;
XmlElement elem1 = doc.CreateElement("name");
elem1.InnerText = uname;
XmlElement elem2 = doc.CreateElement("logtime");
elem2.InnerText = time;
XmlNode userelem = doc.CreateNode(XmlNodeType.Element, "user", "");
userelem.AppendChild(elem1);
userelem.AppendChild(elem2);
root.AppendChild(userelem);
doc.Save(fileurl);
doc = null;
}
catch (Exception ex)
{ }