@bjolling said:
And how can you beat this then?
Teacher aTeacher = new Teacher(5, "Bob");xmlSerializer.Serialize( aTeacher );
Everytime you need to add a new element, just add it as a public property to the Teacher class (which you would have to do anyway). No need to change the code for writing and reading your XML file because the serializer takes care of the mapping. Plenty of attributes out there to cater for your taste of XML.
Yup, that's fine. My example was merely demonstrating how to achieve a reasonable xml structure using concatenation. I didn't say it was the best way, just that it was *a* way.