save xml file

Trying to use the example her:

[code]Dim xml As New XmlDocument

Dim root As XmlNode
root = xml.AppendChild(xml.CreateElement(“League”))

Dim teamNode As XmlNode
Dim playerNode As XmlNode

// Create 1st team and its players
teamNode = root.AppendChild(xml.CreateElement(“Team”))
teamNode.SetAttribute(“name”, “Seagulls”)

playerNode = teamNode.AppendChild(xml.CreateElement(“Player”))
playerNode.SetAttribute(“name”, “Bob”)
playerNode.SetAttribute(“position”, “1B”)

playerNode = teamNode.AppendChild(xml.CreateElement(“Player”))
playerNode.SetAttribute(“name”, “Tom”)
playerNode.SetAttribute(“position”, “2B”)

// Create 2nd team and its players
teamNode = root.AppendChild(xml.CreateElement(“Team”))
teamNode.SetAttribute(“name”, “Pigeons”)

playerNode = teamNode.AppendChild(xml.CreateElement(“Player”))
playerNode.SetAttribute(“name”, “Bill”)
playerNode.SetAttribute(“position”, “1B”)

playerNode = teamNode.AppendChild(xml.CreateElement(“Player”))
playerNode.SetAttribute(“name”, “Tim”)
playerNode.SetAttribute(“position”, “2B”)

TextArea1.Text = xml.ToString

DisplayXML(xml)
Return True[/code]
But it returns error, I am missing something, but what and how?

Best regards Tue.

Do you have a control TextArea1 and a method DisplayXML?

No, I do’nt.
Did’nt thouhgt that it was needed?

I think the control and the method are helpers for debugging. Try to comment the 2 lines out.