var DOM = (function(){
  return {
    /*
     * Returns a child element by its ID. Parent defaults to the entire document.
     */
    id: function(id, parent){
      return (parent || document).getElementById(id);
    },
    
    /*
     * Returns an array of all child elements containing the specified class. Parent defaults to the entire document.
     */
    cls: function(cls, parent){
      return Array.prototype.slice.call((parent || document).getElementsByClassName(cls));
    },
    
    /*
     * Returns an array of all child elements that have the specified tag. Parent defaults to the entire document.
     */
    tag: function(tag, parent){
      return Array.prototype.slice.call((parent || document).getElementsByTagName(tag));
    },
    
    /*
     * Creates an element, adds it to the DOM, and returns it.
     */
    createElement: function(tag, parent){
      var ele = document.createElement(tag);
      parent.appendChild(ele);
      return ele;
    },
    
    /*
     * Removes an element from the DOM.
     */
    removeElement: function(ele){
      ele.parentNode.removeChild(ele);
    }
  };
})();

@@ -16,16 +16,188 @@
 tion()%7B%0A
+  var entityMap = %7B%0A    %22&%22: %22&amp;%22,%0A    %22%3C%22: %22&lt;%22,%0A    %22%3E%22: %22&gt;%22,%0A    '%22': '&quot;',%0A    %22'%22: '&#39;',%0A    %22/%22: '&#x2F;'%0A  %7D;%0A  %0A  var entityRegex = /%5B&%3C%3E%22'%5C/%5D/g;%0A  %0A
   return
@@ -1273,24 +1273,196 @@
 Child(ele);%0A
+    %7D,%0A    %0A    /*%0A     * Converts characters to their HTML entity form.%0A     */%0A    escapeHTML: function(html)%7B%0A      return html.replace(entityRegex, s =%3E entityMap%5Bs%5D);%0A
     %7D%0A  %7D;%0A%7D

Add HTML character escaping to src.dom.js