I understand the problem. I used to use tv_grab_file too, but trust me, the socket method I linked is truly more practical and flexible.
Is your scraper/script actually outputting full valid XML to the standard output? That is likely what the tv_grab_file script is looking for. If it is outputting anything else, like log messages etc., it is not going to work and it will also result in those syntax error messages you are seeing. If it’s writing the XML to a file, your bash script will need to read that file and echo its contents back to the standard output, again avoiding any extraneous messages that would corrupt the standard output.