Depending on the element, which has to be in the correct namespace, the method adds a property to the node or
removes completed nodes from the node stack.
505808
@Override
    public void endElement(final String uri, final String localName, final String qName) throws SAXException {

        LOG.trace("endElement uri={} localName={} qName={}", uri, localName, qName);
        if (this.isNotInkstandNamespace(uri)) {
            return;
        }
        switch (localName) {
            case "rootNode":
                LOG.debug("Closing rootNode");
                this.nodeStack.pop();
                break;
            case "node":
                LOG.debug("Closing node");
                this.nodeStack.pop();
                break;
            case "mixin":
                LOG.debug("Closing mixin");
                break;
            case "property":
                this.endElementProperty();
                break;
            default:
                break;
        }
    }
1343797
function (node) {
        var firstSpecifier = node.specifiers[0]
        var lastSpecifier = node.specifiers[node.specifiers.length - 1]

        // don't do anything for namespace or default imports
        if (firstSpecifier && lastSpecifier && firstSpecifier.type === 'ImportSpecifier' && lastSpecifier.type === 'ImportSpecifier') {
          var first = context.getTokenBefore(firstSpecifier)
          var second = context.getFirstToken(firstSpecifier)
          var penultimate = context.getLastToken(lastSpecifier)
          var last = context.getTokenAfter(lastSpecifier)

          validateBraceSpacing(node, first, second, penultimate, last)
        }
      }
1310739
public void addElement(ObjectProperty element) {
        assertNotNull(element);
        if (elements == null) {
            elements = new ArrayList<ObjectProperty>();
        }
        elements.add(element);
        element.setParent(this);
    }
1042456
public void remove (T element)
    {
        DependencyNode<T> node = _nodes.remove(element);
        _orphans.remove(element);

        // Remove ourselves as a child of our parents.
        for (DependencyNode<T> parent : node.parents) {
            parent.children.remove(node);
        }

        // Remove ourselves as a parent of our children, possibly orphaning them.
        for (DependencyNode<T> child : node.children) {
            child.parents.remove(node);
            if (child.parents.isEmpty()) {
                _orphans.add(child.content);
            }
        }
    }
1105087
private void addNthChild() {
        for (Node node : nodes) {
            int count = 1;
            Node n = DOMHelper.getPreviousSiblingElement(node);
            while (n != null) {
                count++;
                n = DOMHelper.getPreviousSiblingElement(n);
            }
            
            if (specifier.isMatch(count)) {
                result.add(node);
            }
        }
    }
1140137
@Override
    public Object invokeMethod(String methodName, Object args) {
        // detect namespace declared on the added node like xmlns:foo="http:/foo"
    	Map attributes = findAttributes(args);
    	for (Iterator<Map.Entry> iter = attributes.entrySet().iterator(); iter.hasNext();) {
    		Map.Entry entry = iter.next();
    		String key = String.valueOf(entry.getKey());
            if (key.startsWith("xmlns:")) {
                String prefix = key.substring(6);
                String uri = String.valueOf(entry.getValue());
                namespace(uri, prefix);
                iter.remove();
            }
        }

        return super.invokeMethod(methodName, args);
    }
480286
public void add(final T node) {
        if ( this.firstNode == null ) {
            this.firstNode = node;
            this.lastNode = node;
        } else {
            this.lastNode.setNext( node );
            node.setPrevious( this.lastNode );
            this.lastNode = node;
        }
        this.size++;
    }
648185
public void addNamespace( String prefix, String uri, String elementName ) {
      if( StringUtils.isBlank( uri ) ){
         return;
      }
      if( prefix == null ){
         prefix = "";
      }
      if( StringUtils.isBlank( elementName ) ){
         rootNamespace.put( prefix.trim(), uri.trim() );
      }else{
         Map nameSpaces = (Map) namespacesPerElement.get( elementName );
         if( nameSpaces == null ){
            nameSpaces = new TreeMap();
            namespacesPerElement.put( elementName, nameSpaces );
         }
         nameSpaces.put( prefix, uri );
      }
   }
1032984
def add_from_xmlnode(self, element):
        """"""
        if self.tree is None:
            root = ET.Element('interface')
            root.append(element)
            self.tree = tree = ET.ElementTree(root)
            self.root = tree.getroot()
            self.objects = {}
            # ET.dump(tree)
        else:
            # TODO: append to current tree
            pass
164799
function () {
		var element = this.element,
			childNodes = element.childNodes,
			i = childNodes.length,
			node;

		while (i--) {
			node = childNodes[i];
			node.parentNode.removeChild(node);
		}
	}
1346179
function(node) {

				var callee = node.callee,
					subject,
					object;

				// only worry about Object.definePropert[y|ies]
				if (callee.type === "MemberExpression"
						&& callee.object.name === "Object"
						&& (callee.property.name === "defineProperty" || callee.property.name === "defineProperties")) {

					// verify the object being added to is a native prototype
					subject = node.arguments[0];
					object = subject.object;

					if (object &&
						object.type === "Identifier" &&
						modifiedBuiltins.indexOf(object.name) > -1 &&
						subject.property.name === "prototype") {

						context.report(node, ProblemMessages.noExtendNative, {builtin: object.name});
					}
				}

			}
1272455
function (oNode) {
			// if there are subnodes added to the current node -> traverse them first (added nodes are at the top, before any children)
			if (oNode.addedSubtrees.length > 0 && !oNode.nodeState.collapsed) {
				// an added subtree can be either a deep or a flat tree (depending on the addContexts) call
				for (var j = 0; j < oNode.addedSubtrees.length; j++) {
					var oSubtreeHandle = oNode.addedSubtrees[j];
					fnTraverseAddedSubtree(oNode, oSubtreeHandle);
					if (oRecursionBreaker.broken) {
						return;
					}
				}
			}
		}
846781
protected void appendNode(Node n)
    {
        if (mRootNode != null) {
            mRootNode.appendChild(n);
        } else {
            mElement.appendChild(n);
        }
    }
233493
private void addNthLastChild() {
        for (Node node : nodes) {
            int count = 1;
            Node n = DOMHelper.getNextSiblingElement(node);
            while (n != null) {
                count++;
                n = DOMHelper.getNextSiblingElement(n);
            }
            
            if (specifier.isMatch(count)) {
                result.add(node);
            }
        }
    }
1077784
private void appendNode(Node appendNode) {
        if (currentElement==null) {
            currentDocument.appendChild(appendNode);
        } else {
            currentElement.appendChild(appendNode);
        }
    }
875720
function () {
					oNodeForContext.nodeState.removed = false;
					var iNodeStateFound = that._aRemoved.indexOf(oNodeForContext);
					if (iNodeStateFound != -1) {
						that._aRemoved.splice(iNodeStateFound, 1);
					}
					// clear cache to make sure findNode etc. don't deliver wrong nodes (index is shifted due to adding)
					this._aNodeCache = [];
					that._cleanTreeStateMaps();
					that._fireChange({reason: ChangeReason.Add});
				}
967232
function(element) {
    var element = $(element);
    for (var i = 0; i < element.childNodes.length; i++) {
      var node = element.childNodes[i];
      if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) 
        Element.remove(node);
    }
  }