additions to receive_xml to address issues raised in https://mail.gnome.org/archives/xml/2002-February/msg00073.html

and 

https://mail.gnome.org/archives/xml/2003-December/msg00083.html

basically added manual naive check for xml validity before passing a buffer to xmlParse()