Moved XML parser into a separate class