}
 
 
-
 function xml2html(options) {
     withStylesheets(function() {
-        var xml = options.xml.replace(/\/\s+/g, '<br />');
+        var xml = options.xml.replace(/\/(\s+)/g, '<br />$1');
         var parser = new DOMParser();
         var serializer = new XMLSerializer();
         var doc = parser.parseFromString(xml, 'text/xml');
         }
 
         if (error.length > 0 && options.error) {
-            options.error(error.text());
+            source = $('sourcetext', doc);
+            source_text = source.text();
+            source.text('');
+            options.error(error.text(), source_text);
         } else {
             options.success(doc.firstChild);