diff --git a/lib/render.js b/lib/render.js
index <HASH>..<HASH> 100644
--- a/lib/render.js
+++ b/lib/render.js
@@ -3,7 +3,7 @@
 */
 var _ = require('lodash');
 var utils = require('./utils');
-var encode = require('entities').encodeXML;
+var entities = require('entities');
 
 /*
   Boolean Attributes
@@ -46,7 +46,7 @@ var formatAttrs = function(attributes) {
     if (!value && booleanAttributes[key]) {
       output += key;
     } else {
-      output += key + '="' + encode(value || '') + '"';
+      output += key + '="' + entities.escape(value || '') + '"';
     }
   }
 
@@ -149,7 +149,7 @@ var renderDirective = function(elem) {
 };
 
 var renderText = function(elem) {
-  return encode(elem.data || '');
+  return entities.encodeXML(elem.data || '');
 };
 
 var renderCdata = function(elem) {
use `entities.escape` for attribute values

partially fix for #<I> (`&apos;` won't be used anymore)