Adds a Child Element to the Level. If the Child Element already has a parent, then it is removed from that parent and
added to this level.

@param child A Child element to be added to the Level.
542493
public void appendChild(final Node child) {
        if (child instanceof Level) {
            // Append the level
            levels.add((Level) child);
            nodes.add(child);
            if (child.getParent() != null) {
                child.removeParent();
            }
            child.setParent(this);
        } else if (child instanceof SpecTopic) {
            appendSpecTopic((SpecTopic) child);
        } else if (child instanceof CommonContent) {
            // Append the common content
            commonContents.add((CommonContent) child);
            nodes.add(child);
            if (child.getParent() != null) {
                child.removeParent();
            }
            child.setParent(this);
        } else {
            nodes.add(child);
            if (child.getParent() != null) {
                child.removeParent();
            }
            child.setParent(this);
        }
    }
1213495
def add_child(self, child):
        
        # Make sure the child exists before adding it.
        if child:
            # Append child if it is allowed to exist under the parent.
            if child.tag in self.contained_children:
                self.children.append(child)
            else:
                raise DC_StructureException(
                    'Invalid child "%s" for parent "%s"' %
                    (child.tag, self.tag)
                )
492144
public void addChildCluster(Cluster<M> parent, Cluster<M> child) {
    hierarchy.add(parent, child);
  }
107261
@SuppressWarnings("unchecked")
  public void addChildren(List<? extends N> children) {
    // NOTE: if the input list comes from another node, this could cause
    // ConcurrentModificationExceptions as nodes are moved from one parent to another.  To avoid
    // this we make a copy of the input list.
    for (Node child : children.toArray(new Node[0])) {
      addChild((N) child);
    }
  }
1084981
public static void lazyAppend(Element parent, Element child) {
        if (!parent.contains(child)) {
            parent.appendChild(child);
        }
    }
1323658
@Override
	public void addChild(final ITreeNode<T> child)
	{
		if (children != null)
		{
			children.add(child);
		}
		else
		{
			children = new ArrayList<>();
			children.add(child);
		}

	}
115884
public void addChild(PdfLayer child) {
        if (child.parent != null)
            throw new IllegalArgumentException("The layer '" + ((PdfString)child.get(PdfName.NAME)).toUnicodeString() + "' already has a parent.");
        child.parent = this;
        if (children == null)
            children = new ArrayList();
        children.add(child);
    }
885342
public void removeChild(final Node child) {
        if (child instanceof Level) {
            levels.remove(child);
            nodes.remove(child);
            child.setParent(null);
        } else if (child instanceof SpecTopic) {
            removeSpecTopic((SpecTopic) child);
        } else if (child instanceof CommonContent) {
            commonContents.remove(child);
            nodes.remove(child);
            child.setParent(null);
        } else {
            nodes.remove(child);
            child.setParent(null);
        }
    }
902609
protected void moveChild(BaseUIComponent child, BaseUIComponent before) {
        child.getParent().addChild(child, before);
    }
165651
public void addChild(HierarchicalFormModel child) {
		Assert.notNull(child, "child");
		if (child.getParent() == this)
			return;
		Assert.isTrue(child.getParent() == null, "Child form model '" + child + "' already has a parent");
		child.setParent(this);
		children.add(child);
		child.addPropertyChangeListener(DIRTY_PROPERTY, childStateChangeHandler);
		child.addPropertyChangeListener(COMMITTABLE_PROPERTY, childStateChangeHandler);
		if (child.isDirty())
		{
			dirtyValueAndFormModels.add(child);
			dirtyUpdated();
		}
	}
1014590
public static <T extends MutableTreeNode<T>> void removeChild(T parent, T child) {
        checkArgNotNull(parent, "parent");
        int index = parent.getChildren().indexOf(child);
        checkElementIndex(index, parent.getChildren().size());
        parent.removeChild(index);
    }
1194460
public void removeChild(Xml child)
    {
        Check.notNull(child);

        root.removeChild(child.getElement());
    }
906814
def add_child(self, child):
        
        child_id = getattr(child, 'id', None)
        if child_id:
            if not hasattr(self, 'children'):
                self.children = {}
            if child_id not in self.children:
                self.children[child_id] = child
799132
public function addChild(Node $child)
    {
        $this->children[]                           = $child;
        $child->parent                              = $this;
        $child->properties[$this->config['parent']] = $this->properties[$this->config['pk']];
    }
962703
public static <T extends MutableTreeNode<T>> void addChild(T parent, T child) {
        checkArgNotNull(parent, "parent");
        parent.addChild(parent.getChildren().size(), child);
    }
1133435
public void add(T parent, T child) {
        final Set<T> children = depTree.computeIfAbsent(parent, p -> new LinkedHashSet<>());
        if (!child.equals(parent)) {
            children.add(child);
        }
    }
759440
public void addFirstChild( AstNode child ) {
        assert child != null;
        this.children.addFirst(child);
        child.removeFromParent();
        child.parent = this;
    }