Emits child element collection and their descendants. Works only with preserved nodes.
172672
function emitChildren(elements) {
  var i;
  for (i = 0; i < elements.length; i++) {
    var element = elements[i];
    if (typeof element === 'object') {
      emitStart.call(this, element.$name, element.$);
      emitChildren.call(this, element.$children);
      emitEnd.call(this, element.$name);
    } else {
      emitText.call(this, element);
    }
  }
}
577423
private void visitChildren(Node parent, Collection<Class<? extends Node>> includeNodes) {
    Node child = parent.getFirstChild();
    while (child != null) {
      // A subclass of this visitor might modify the node, resulting in getNext returning a different node or no
      // node after visiting it. So get the next node before visiting.
      Node next = child.getNext();
      if (includeNodes.contains(child.getClass())) {
        child.accept(this);
      } else {
        visitChildren(child, includeNodes);
      }
      child = next;
    }
  }
668873
def process_text_list_item( element, output_node )
      style_name = register_style( element )
      item = emit_element( output_node, "li", {"class" => style_name} )
      process_children( element, item )
    end
59374
function () {
        // Iterate children_resources
        _.each(this.children_resources, (resource, resourceName) => {
          // Iterate object json data
          _.each(this._json, (object, key) => {
            // If children_resource and object different, next
            if (resourceName !== key) {
              return
            }

            if (object instanceof Array) {
              /*
             * Iterate array object to extend from
             * target Conekta resource and overwrite attribute
             */
              const childrenObjects = []
              _.each(object, (elem) => {
                const resourceInstance = _.extend({}, Conekta[resource])
                childrenObjects.push(
                  _.extend(resourceInstance, {
                    _json: elem,
                    _id: elem.id
                  })
                )
              })

              /* overwrite property */
              this[key] = childrenObjects
            } else if (object) {
              /* overwrite property */
              this[key] = _.extend(Conekta[resource], {
                _json: object,
                _id: object.id
              })
            }
          })
        })
      }
495696
private Element getChildElement(Element parent) {
	NodeList list = parent.getChildNodes();
	int len = list.getLength();
	for (int i = 0; i < len; i++) {
	    Node node = list.item(i);
	    if (node instanceof Element) {
		return (Element) node;
	    }
	}
	return null;
    }
1104069
def emit_node(self, node):
        """"""
        emit = getattr(self, "%s_emit" % node.kind, self.default_emit)
        return emit(node)
67833
private void addChildElements() {
		for (Node node : nodes) {
			Collection<? extends Node> childNodes = helper.getChildNodes(node);
			for (Node child : childNodes)
				if (matchTag(child))
					result.add(child);
		}
	}
835422
def collect_children
      children = []
      embedded_relations.each_pair do |name, association|
        without_autobuild do
          child = send(name)
          Array.wrap(child).each do |doc|
            children.push(doc)
            children.concat(doc._children)
          end if child
        end
      end
      children
    end
1261916
function(index) {
    var result = _.extend({}, index.nodes);
    _.each(index.scopes, function(child, name) {
      if (name !== "nodes") {
        _.extend(result, _collect(child));
      }
    });
    return result;
  }
103679
def __radiateUp(self, x1, x2, childId, condition) :
		" "
		ret = []
		i = childId
		while i < len(self.children):
			if condition(x1, x2, self.children[i]) :
				ret.append(self.children[i])
			else :
				break
			i += 1
		return ret
1349929
private void emit() throws TTIOException {
        // Emit pending end elements.
        if (mCloseElements) {
            if (!mStack.empty() && mStack.peek() != ((ITreeStructData)mRtx.getNode()).getLeftSiblingKey()) {
                mRtx.moveTo(mStack.pop());
                emitEndTag();
                mRtx.moveTo(mKey);
            } else if (!mStack.empty()) {
                mRtx.moveTo(mStack.pop());
                emitEndTag();
                mRtx.moveTo(mKey);
                mCloseElements = false;
                mCloseElementsEmitted = true;
            }
        } else {
            mCloseElementsEmitted = false;

            // Emit node.
            emitNode();

            final long nodeKey = mRtx.getNode().getDataKey();
            mLastKey = nodeKey;

            // Push end element to stack if we are a start element.
            if (mRtx.getNode().getKind() == ELEMENT) {
                mStack.push(nodeKey);
            }

            // Remember to emit all pending end elements from stack if
            // required.
            if (!((ITreeStructData)mRtx.getNode()).hasFirstChild()
                && !((ITreeStructData)mRtx.getNode()).hasRightSibling()) {
                mGoUp = true;
                moveToNextNode();
            } else if (mRtx.getNode().getKind() == ELEMENT && !((ElementNode)mRtx.getNode()).hasFirstChild()) {
                // Case: Empty elements with right siblings.
                mGoBack = true;
                moveToNextNode();
            }
        }
    }
1035793
def descendants(self):
        """"""
        for i in self.current_item.items:
            self.move_to(i)
            if i.type == TYPE_COLLECTION:
                for c in self.children:
                    yield c
            else:
                yield i
            self.move_up()
656555
def collect(self, parents=None):
        
        results = self.execute(parents=parents)
        ids = results.keys()
        for child in self.nested():
            name = child.node.name
            for child_data in child.collect(parents=ids).values():
                parent_id = child_data.pop('$parent', None)
                if child.node.many:
                    if name not in results[parent_id]:
                        results[parent_id][name] = []
                    results[parent_id][name].append(child_data)
                else:
                    results[parent_id][name] = child_data
        return results
673802
function lastChildElement (parent, callback) {
  for (let child = parent.lastElementChild; child; child = child.previousElementSibling) {
    if (callback(child)) {
      return child
    }
  }
  return null
}
424100
private void collectActiveElements(final List<GraphObject> resultList, final DOMNode root, final Set<String> parentDataKeys, final String parent, final int depth) {

		final String childDataKey  = root.getDataKey();
		final Set<String> dataKeys = new LinkedHashSet<>(parentDataKeys);
		String parentId            = parent;
		int dataCentricDepth       = depth;

		if (!StringUtils.isEmpty(childDataKey)) {

			dataKeys.add(childDataKey);
			dataCentricDepth++;
		}

		final ActiveElementState state = isActive(root, dataKeys);
		if (!state.equals(ActiveElementState.None)) {

			resultList.add(extractActiveElement(root, dataKeys, parentId, state, depth));
			if (state.equals(ActiveElementState.Query)) {

				parentId = root.getUuid();
			}
		}

		for (final DOMNode child : root.getChildren()) {

			collectActiveElements(resultList, child, dataKeys, parentId, dataCentricDepth);
		}

	}
154877
function renderNode(node, children = []) {
    [...children].forEach(child => {
        if (child && child.tag) {
            node.ele(child.tag, child.props);
            renderNode(node, child.children);
            node.end();
        } else {
            node.text(child);
        }
    });
}
89689
def span_descendents(e)
      ns = Nokogiri::XML::NodeSet.new(Nokogiri::XML::Document.new)
      e.element_children.inject(ns) do |descendents, c|
        if HTML_INLINE_ELEMS.include?(c.name)
          descendents << c
          descendents += span_descendents(c)
        end
        descendents
      end
    end