I am trying to add a namespace tag to an XML document using system.XML in C# Here is my code so far:
XmlDocument doc = new XmlDocument();
XmlDeclaration xmlDeclaration = doc.CreateXmlDeclaration("1.0", "UTF-8", null);
XmlElement root = doc.DocumentElement;
doc.InsertBefore(xmlDeclaration, root);
XmlElement invHeaderTag = doc.CreateElement(string.Empty, "InvoiceHeader", string.Empty);
doc.AppendChild(invHeaderTag);
The image below show the XML I am trying to create.
How do I create the namespace tag?