switched DOM error handling to libxml, closes #396