XmlDocument doc = new XmlDocument();
XmlDeclaration xmldecl;
xmldecl = doc.CreateXmlDeclaration("1.0", "UTF-8", null);
//Add the new node to the document.
XmlElement root = doc.DocumentElement;
doc.InsertBefore(xmldecl, root);
doc.AppendChild(doc.CreateElement("item", "urn:1"));
doc.PreserveWhitespace = false;
doc.Save("C:\\1.xml");