12

I need to create an XML file using an xmldocument object in C#.

How can I add a root element like:

 book:aaaa xsi:schemalocationchemaLocation="http://www.com"
Laurel
  • 5,965
  • 14
  • 31
  • 57
Rakesh kumar
  • 121
  • 1
  • 1
  • 4

1 Answers1

19
XmlDocument doc = new XmlDocument();
XmlElement elem = doc.CreateElement("book", "aaaa", "http://www.com");
doc.AppendChild(elem);
Matthias
  • 1,032
  • 8
  • 21