Dim doc As New XmlDocument()
doc.Load("C:\test.xml")
Dim node As XmlNode = doc.CreateNode(XmlNodeType.Element, "", "ConfigValues", "")
'// Create a new OptionName node
Dim child As XmlNode = doc.CreateNode(XmlNodeType.Element, "", "OptionName", "")
child.InnerText = "New Option"
node.AppendChild(child)
'// Create a new OptionValue node
child = doc.CreateNode(XmlNodeType.Element, "", "OptionValue", "")
child.InnerText = "New Value"
node.AppendChild(child)
'// Append to the main document
doc.DocumentElement.AppendChild(node)
doc.Save("C:\test.xml")
|