code: public RemoveInfo addElement(TreeElement elem)
      {
          // if the attributes are empty then there is nothing to add to lists
          ArrayList attrs = elem.getAttributeList();
          if (attrs == null || attrs.size() == 0)
              return emptyRemoves;
  
          // We will track all of the elements that we are removing from the current inheritence
          // list set and return those back to the caller to stash away on the stack.
          RemoveInfo removes = _removes;
          if (removes == null)
              removes = new RemoveInfo();
  
          // walk all of the attributes
          int cnt = attrs.size();
          assert (cnt > 0);
          for (int i = 0; i < cnt; i++) {
              TreeHtmlAttributeInfo attr = (TreeHtmlAttributeInfo) attrs.get(i);
              if (attr.isOnDiv()) {
                  addAttribute(TreeHtmlAttributeInfo.HTML_LOCATION_DIV, attr, removes);
              }
              if (attr.isOnIcon()) {
                  addAttribute(TreeHtmlAttributeInfo.HTML_LOCATION_ICON, attr, removes);
              }
              if (attr.isOnSelectionLink()) {
                  addAttribute(TreeHtmlAttributeInfo.HTML_LOCATION_SELECTION_LINK, attr, removes);
              }
          }
  
          // if we didn't remove anything then we should simply stash the array list away for next time
          // and return null.
          if (removes.removes.size() == 0) {
              _removes = removes;
              removes = null;
          }
          else {
              _removes = null;
          }
  
          return removes;
      }
docs: Add all of the attributes associated with an element to the internal lists.
  @param elem