diff --git a/lib/xml/xmldom.js b/lib/xml/xmldom.js
index 752c353f0c97f86280c96984fe963c8b6f6d0c6c..b75bd10746eb035276cfded6d624e2cbda3c3c6e 100644
--- a/lib/xml/xmldom.js
+++ b/lib/xml/xmldom.js
@@ -2,20 +2,22 @@ var xmldom = require("@xmldom/xmldom");
 var dom = require("@xmldom/xmldom/lib/dom");
 
 function parseFromString(string) {
-    var error = null;
+    var fatalError = null;
 
     var domParser = new xmldom.DOMParser({
-        errorHandler: function(level, message) {
-            error = {level: level, message: message};
+        onError: function(level, message) {
+            if (level === "fatalError") {
+                fatalError = message;
+            }
         }
     });
 
-    var document = domParser.parseFromString(string);
+    var document = domParser.parseFromString(string, "text/xml");
 
-    if (error === null) {
+    if (fatalError === null) {
         return document;
     } else {
-        throw new Error(error.level + ": " + error.message);
+        throw new Error("fatalError: " + fatalError);
     }
 }
 
