added debug logging to xml.c
added error logging callbacks to xml parser