I did that already, where I gave you an outline of how to do it.
But this DOM programming is hard to understand for a beginner, so let me give you some homework.
You have an XML file of the right format, so first write a program which reads it and prints the student info from it.
Next, change that program so it reads the file, adds a student to the DOM, then writes it out to the file.
Once you have that done
you should have a better idea of what to do.