switched DOM error handling to libxml, closes #321