docs: function findReferencedElements() {
  
    var ids = {};
  
    _($('*')).each(function(node) {
      var $node = $(node);
  
      if(node.name == 'style') {
        var styles = CSSOM.parse($node.text());
        _(styles.cssRules).each(function(rule) {
          _(referencingProperties).each(function(referencingProperty) {
            if(_(rule.style).has(referencingProperty)) {
              var id = extractReferencedId(rule.style[referencingProperty]);
              if(id) {
                addReferencingElement(ids, id, REFERENCE_TYPE.STYLE_TAG, node);
              }
            }
          });
        });
        return;
      }
  
      // if xlink:href is set, then grab the id
      var href = $node.attr('xlink:href');
      if(href && (href.indexOf('data:') !== 0)) {
        addReferencingElement(ids, href, REFERENCE_TYPE.XLINK, node);
      }
  
      // now get all style properties
      var styles = parseStyles($node.attr('style'));
  
      _(referencingProperties).each(function(referencingProperty) {
        // first check attributes
        var value = $node.attr(referencingProperty);
        if(!_.isUndefined(value)) {
          var id = extractReferencedId(value);
          if(id) {
            addReferencingElement(ids, id, REFERENCE_TYPE.ATTRIBUTE, node, referencingProperty);
          }
        }
        // then inline styles
        if(_(styles).has(referencingProperty)) {
          var id = extractReferencedId(styles[referencingProperty]);
          if(id) {
            addReferencingElement(ids, id, REFERENCE_TYPE.STYLE_ATTRIBUTE, node);
          }
        }
      });
  
    });
  
    return ids;
  }