Running into a weird error, probably a type error, upon attempting to parse XML