Adds an element to the root.
170895
def add_element name, value = nil
      value = value.respond_to?(:xmlschema) ? value.xmlschema : value.to_s
      XML.new super(name, value)
    end
517706
public void add(E datum) {
        if (root == null) {
            root = new Node(count++, datum);
        } else {
            root.add(datum);
        }
    }
1236578
public void setRootNode(TreeElement rootNode)
    {
        _rootNode = rootNode;
        if (rootNode.getName() == null) {
            rootNode.setName("0");
        }
    }
444201
def apply(self, root):
        
        if not self.filter.match(root, self.ns):
            return
        if self.exists(root):
            return
        node = Element('import', ns=self.xsdns)
        node.set('namespace', self.ns)
        if self.location is not None:
            node.set('schemaLocation', self.location)
        log.debug('inserting: %s', node)
        root.insert(node)
686497
function (el) {
        if (el.__storage === this) {
            return;
        }

        if (el instanceof Group) {
            el.addChildrenToStorage(this);
        }

        this.addToStorage(el);
        this._roots.push(el);
    }
68683
def add(self, node):
        """"""
        if not isinstance(node, Node):
            raise TypeError()
        for i, j in enumerate(self.__nodes):
            if j.node_id == node.node_id:
                self.__nodes[i] = node
                return
        self.__nodes.append(node)
293468
public void add(XmlReader node)
    {
        Check.notNull(node);

        final Element element = node.getElement();
        document.adoptNode(element);
        root.appendChild(element);
    }
877200
def append(self, node):
        
        if isinstance(node, basestring):
            self.__root = Element(node)
            return
        if isinstance(node, Element):
            self.__root = node
            return
491975
public void addAction(M element, short value)
    {
        actions.put(element, Short.valueOf(value));
    }
96522
def _add_element(self, element, parent_node):
        
        if element.tag == 'unit':
            element_node_id = element.attrib['id']+':'+element.attrib['type']
            node_layers = {self.ns, self.ns+':unit', self.ns+':'+element.attrib['type']}
        elif element.tag == 'connective':
            element_node_id = element.attrib['id']+':connective'
            node_layers = {self.ns, self.ns+':connective'}
        elif element.tag == 'discourse':
            element_node_id = 'discourse'
            node_layers = {self.ns}
        else:  # <modifier>
            element_node_id = element.getparent().attrib['id']+':'+element.tag
            node_layers = {self.ns, self.ns+':modifier'}

        self.add_node(element_node_id, layers=node_layers)
        self.add_edge(parent_node, element_node_id, layers={self.ns},
                      edge_type=EdgeTypes.dominance_relation)

        if element.text:
            if self.tokenize:
                for token in element.text.split():
                    self._add_token(token, element_node_id)
            else:
                element_text = sanitize_string(element.text)
                self.node[element_node_id].update(
                    {'label': u"{0}: {1}...".format(element_node_id,
                                                   element_text[:20])})


        for child_element in element.iterchildren():
            self._add_element(child_element, element_node_id)

        if element.tail:  # tokens _after_ the </element> closes
            if self.tokenize:
                for token in element.tail.split():
                    self._add_token(token, parent_node)
            else:
                tail_text = sanitize_string(element.tail)
                self.node[parent_node].update(
                    {'label': u"{0}: {1}...".format(parent_node,
                                                    tail_text[:20])})
895962
def add(self, element, pad=0):
        
        set.add(self, int(element))
        if pad > 0 and self.padding is None:
            self.padding = pad
772382
void appendEndElement()
  {
    // pop up the stacks

    if (previousSiblingWasParent)
      nodes.writeEntry(previousSibling, 2, NULL);

    // Pop parentage
    previousSibling = currentParent;
    nodes.readSlot(currentParent, gotslot);
    currentParent = gotslot[1] & 0xFFFF;

    // The element just being finished will be
    // the previous sibling for the next operation
    previousSiblingWasParent = true;

    // Pop a level of namespace table
    // namespaceTable.removeLastElem();
  }
268797
def add(self, value):
        """"""
        path = value if isinstance(value, Path) else Path(str(value))
        if path and path != path.parent:
            destination = self
            for part in path.parts:
                destination = destination.setdefault(part, DirectoryTree())
454672
function insert(root, nextTag, isVirtual) {
      if (isVirtual)
        { makeVirtual.apply(this, [root, nextTag]); }
      else
        { safeInsert(root, this.root, nextTag.root); }
    }
1334194
function addToTree (elem, callback) {
    const pathElems = toPathComponents(elem.path || '')
    let parent = tree
    const lastIndex = pathElems.length - 1

    let currentPath = ''
    eachOfSeries(pathElems, (pathElem, index, callback) => {
      if (currentPath) {
        currentPath += '/'
      }
      currentPath += pathElem
      const last = (index === lastIndex)
      parent.dirty = true
      parent.multihash = null
      parent.size = null

      if (last) {
        waterfall([
          (callback) => parent.put(pathElem, elem, callback),
          (callback) => flatToShard(null, parent, options.shardSplitThreshold, options, callback),
          (newRoot, callback) => {
            tree = newRoot
            callback()
          }
        ], callback)
      } else {
        parent.get(pathElem, (err, treeNode) => {
          if (err) {
            callback(err)
            return // early
          }
          let dir = treeNode
          if (!dir || !(dir instanceof Dir)) {
            dir = DirFlat({
              dir: true,
              parent: parent,
              parentKey: pathElem,
              path: currentPath,
              dirty: true,
              flat: true
            }, options)
          }
          const parentDir = parent
          parent = dir
          parentDir.put(pathElem, dir, callback)
        })
      }
    }, callback)
  }
626963
public Node<T> add(T element) {
		Node<T> node = new Node<>(this, element);
		nodes.add(node);
		return node;
	}
127208
def add_child(self, node):
        """"""
        node._parent = self
        self._children.append(node)