Try:
XDocument document = XDocument.Parse("<Employees></Employees>")
or
XElement root = new XElement("Employees")
Another way is to use the XmlDocument class:
XmlDocument document = new XmlDocument(); document.LoadXml("<Employees></Employees>");
but I recommend using XDocument . It is newer than XmlDocument , it has a cleaner API and supports Linq To Xml .
source share