Asp validating parser sax
Also we assume that in his application, the instructor use no data structure such as arrays to store the student personal information and the points.
If the instructor decides to give A's to those who earned the class average or above, and give B's to the others, then he'd better to use a DOM parser in his application.
The reason is that he has no way to know how much is the class average before the entire document gets processed.
What he probably need to do in his application, is first to look through all the students' points and compute the average, and then look through the document again and assign the final grade to each student by comparing the points he earned to the class average.
What he needs to do is to first modify the DOM tree (i.e., set value to the 'grade' node) and then save the whole modified tree.