Return with Error object if xml parsing failed.