Added gitignore file
Tidied up Makefile and code files.
Refactored the XML parsing code so there's less code involved in
traversing a document.