Finally got a working XML parser up and running; a bit messy atm but will update later