The first page SubPage1.html generates the list of presidents by parsing it from the .xml document and writes it to the new page.
I was unable to recreate the function (the function I wrote works perfectly in a new file but when it is written using document.write, it messes up and generates errors. I am therefore attaching this function too. If it finds presidents.xml and error.xml in the local directory, it should work fine) for processing the other half of the problem due to white spaces and hence i generated a second page page_generator_processor.html to process all the information and produce the the information and produce the table.
The second file processes the xml document and extracts all information. It also puts it in the table by generating the table.