Re: Add multiple records to xml file
1. Questions:
Do you really need to save the xml in a file, as opposed to some runtime memory object, perhaps as a string even?
If so, you could onClose, create a function which reads the text from the xml file and puts it into the textBox. However this seems like more work than necessary. It'd be easier if you had your XmlTextWriter write to a stringBuffer or stream, and then output the string to both the xml file and the textBox.
2. You need to create a function to read the xml you've written, eg an XmlReader.
After reading the xml in, you'd have a loop that rewrites the data to the new result as it reads it in from the old. Event style input/output is definitely the way to go, (eg the way you already have it by using XmlTextWriter). DOM would be overkill.