bail out early if outfile is not valid xml