How to write XML file by using dotnet code?
void CreateXmlFile(String xmlFilePath) { XmlTextWriter xmlWriter = new XmlTextWriter(xmlFilePath, Encoding.UTF8); xmlWriter.WriteStartDocument(true); xmlWriter.WriteStartElement(“Departments”); //Root Element xmlWriter.WriteStartElement(“Department”); //Department Element xmlWriter.WriteStartAttribute(“Name”); //Attribute “Name” xmlWriter.WriteString(“Development”); //Attribute Value xmlWriter.WriteEndAttribute(); xmlWriter.WriteStartElement(“Employees”); //Started Employees Element xmlWriter.WriteStartElement(“Employee”); //Started Employee Element xmlWriter.WriteStartAttribute(“Name”); //Attribute “Name” xmlWriter.WriteString(“Sabu C.Alex”); //Attribute Value xmlWriter.WriteEndAttribute(); xmlWriter.WriteStartAttribute(“Age”);//Attribute “Age” xmlWriter.WriteString(“28”);//Attribute Value xmlWriter.WriteEndAttribute(); xmlWriter.WriteString(“Sabu C.Alex is working as… Continue reading