Flush libxml error buffer

Adding libxml_clear_errors() before using libxml to prevent previous errors from another lib using libxml