docs: function removeUnreferencedElements() {
  
    var referencedIDs = findReferencedElements();
  
    var alwaysKeepTags = ['font', 'style', 'metadata', 'script', 'title', 'desc'];
    function removeUnreferencedElementsInTag(node) {
      _($(node).children()).each(function(node) {
        
        // scour:
        // > we only remove if it is not one of our tags we always keep (see above)
        if(_(alwaysKeepTags).indexOf(node.name) !== -1) {
          return;
        }
        var $node = $(node);
        var id = $node.attr('id');
        if(!_(referencedIDs).has(id)) {
          if(node.name == 'g') {
            // scour:
            // > we only inspect the children of a group in a defs if the group
            // > is not referenced anywhere else
            removeUnreferencedElementsInTag(node);
          } else {
            $(node).remove();
          }
        }
      });
    }
    // scour:
    // > Remove most unreferenced elements inside defs
    _($('defs')).each(removeUnreferencedElementsInTag);
  
    // scour:
    // > Remove certain unreferenced elements outside of defs
    var identifiedElements = $('* > linearGradient[id], * > radialGradient[id], * > pattern[id]');
    
    _(identifiedElements).each(function(node) {
      var id = $(node).attr('id');
      if(!_(referencedIDs).has(id)) {
        $(node).remove();
      }
    });
  
  }