Part 1: finished XML parser