@Mads Hansen lead me in the right direction. It was a matter of using the option -xml_repair_level full