Lets process a single node, and collect its children
357767
public function process() {
		$remainingChildren = $this->remainingChildren;

		if (!count($remainingChildren)) {
			$this->isComplete = true;
			return;
		}

		$this->currentStep++;

		// lets process our first item
		$pair = array_shift($remainingChildren);
		$sourceObject = ExternalContent::getDataObjectFor($pair->sourceID);
		if (!$sourceObject) {
			$this->addMessage("Missing source object for " . $pair->sourceID, 'WARNING');
			$this->remainingChildren = $remainingChildren;
			return;
		}

		$targetObject = DataObject::get_by_id($pair->targetType, $pair->targetID);
		if (!$targetObject) {
			$this->addMessage("Missing target object for $pair->targetType $pair->sourceID", 'WARNING');
			$this->remainingChildren = $remainingChildren;
			return;
		}

		// lets do a single import first, then check the children and append them
		$pageType = $this->getExternalType($sourceObject);
		if (isset($this->contentTransforms[$pageType])) {
			$transformer = $this->contentTransforms[$pageType];

			$result = $transformer->transform($sourceObject, $targetObject, $this->duplicateStrategy);

			// if there's more, then transform them
			if ($this->includeChildren && $result && $result->children && count($result->children)) {
				foreach ($result->children as $child) {
					$remainingChildren[] = new EC_SourceTarget($child->ID, $result->page->ID, $result->page->ClassName);
					$this->totalSteps++;
				}
			}
		}

		$this->remainingChildren = $remainingChildren;

		if (!count($remainingChildren)) {
			$this->isComplete = true;
			return;
		}
	}
1121698
def iter_child_nodes(node):
    """"""
    for name, field in iter_fields(node):
        if isinstance(field, AST):
            yield field
        elif isinstance(field, list):
            for item in field:
                if isinstance(item, AST):
                    yield item
686218
public void processChildren(Node node) {
		for (Node cursor = node.getFirstChild(); cursor != null; cursor = cursor.getNext()) {
			if (cursor.getType() == Token.CALL) {
				// The node is a function or method call
				Node name = cursor.getFirstChild();
				if (name != null && name.getType() == Token.NAME && // named function call
						name.getString().equals("define")) { // name is "define" //$NON-NLS-1$
					Node param = name.getNext();
					if (param != null && param.getType() != Token.STRING) {
						String expname = name.getProp(Node.SOURCENAME_PROP).toString();
						if (source != null) {
							PositionLocator locator = source.locate(name.getLineno(), name.getCharno()+6);
							char tok = locator.findNextJSToken();	// move cursor to the open paren
							if (tok == '(') {
								// Try to insert the module name immediately following the open paren for the
								// define call because the param location will be off if the argument list is parenthesized.
								source.insert("\"" + expname + "\",", locator.getLineno(), locator.getCharno()+1); //$NON-NLS-1$ //$NON-NLS-2$
							} else {
								// First token following 'define' name is not a paren, so fall back to inserting
								// before the first parameter.
								source.insert("\"" + expname + "\",", param.getLineno(), param.getCharno()); //$NON-NLS-1$ //$NON-NLS-2$
							}
						}
						param.getParent().addChildBefore(Node.newString(expname), param);
					}
				}
			}
			// Recursively call this method to process the child nodes
			if (cursor.hasChildren())
				processChildren(cursor);
		}
	}
337895
function parseChildren(xmlNode, bRoot, bIgnoreToplevelTextNodes) {
			var children = xmlNode.childNodes;
			for (var i = 0; i < children.length; i++) {
				parseNode(children[i], bRoot, bIgnoreToplevelTextNodes);
			}
		}
2123
function children(selector) {
  var arr = [], slice = this.slice, nodes, matches;
  this.each(function(el) {
    nodes = slice.call(el.childNodes);
    // only include elements
    nodes = nodes.filter(function(n) {
      if(n instanceof Element) { return n;}
    })
    // filter direct descendants by selector
    if(selector) {
      matches = slice.call(el.querySelectorAll(selector));
      for(var i = 0;i < nodes.length;i++) {
        if(~matches.indexOf(nodes[i])) {
          arr.push(nodes[i]);
        }
      }
    // get all direct descendants
    }else{
      arr = arr.concat(nodes);
    }
  });
  return this.air(arr);
}
724428
function processNode(node) {
            const entity = node.code.trim()
            if (!entity) {
                context.report({
                    node,
                    messageId: "missing",
                })
            }
        }
995108
def parse_children(self, node):
        

        if 'name' in node.lattrib:
            name = node.lattrib['name']
        else:
            self.raise_error('<Children> must specify a name.')

        if 'type' in node.lattrib:
            type_ = node.lattrib['type']
        else:
            self.raise_error("Children '{0}' must specify a type.", name)

        self.current_component_type.add_children(Children(name, type_, True))
1360447
def get_child(self, value):
        
        for node in self.children:
            if node.value == value:
                return node

        return None
699628
private static <T extends HierarchyEntity<T, ?>> void loadChildren(T node, Set<T> children) {
    if (null == node.getChildren()) { return; }
    for (T one : node.getChildren()) {
      children.add(one);
      loadChildren(one, children);
    }
  }
1194512
def parse(self, nodes):
    """"""
    self.last_node_type = self.initial_node_type
    for node_number, node in enumerate(nodes):
      try:
        self.step(node)
      except Exception as ex:
        raise Exception("An error occurred on node {}".format(node_number)) from ex
91445
function SingleStarIterator(node, match, all) {
  this.q = node.children.toArray();
  this.m = match;
  this.a = all;
}
81373
def nodes(self, node=None):
        ''''''
        if node is None:
            for root in self.stack:
                yield from self.nodes(root)
        else:
            yield node
            if node.is_container():
                for child in node.children:
                    yield from self.nodes(child)
670737
def parse_child_elements(self, element):
        ''''''
        for child in element.iterchildren():
            self.parsers[child.tag](child)
725361
def dump_children(self, obj):
        """"""
        data, errors = PIDSchema(many=True).dump(
            obj.children.ordered('asc').all())
        return data
834922
def parse_content(node)
      content = if node.children.empty?
        node.content
      else
        parse_nodes(node.children)
      end
    end
343043
def nodes_in(self, name) -> iter:
        """"""
        yield from (node for node in self.all_in(name) if self.is_node(node))
948875
def process_children(self, node, parent, pmod):
        
        for ch in node.i_children:
            if ch.keyword in ["rpc", "notification"]: continue
            if ch.keyword in ["choice", "case"]:
                self.process_children(ch, parent, pmod)
                continue
            if ch.i_module.i_modulename == pmod:
                nmod = pmod
                nodename = ch.arg
            else:
                nmod = ch.i_module.i_modulename
                nodename = "%s:%s" % (nmod, ch.arg)
            ndata = [ch.keyword]
            if ch.keyword == "container":
                ndata.append({})
                self.process_children(ch, ndata[1], nmod)
            elif ch.keyword == "list":
                ndata.append({})
                self.process_children(ch, ndata[1], nmod)
                ndata.append([(k.i_module.i_modulename, k.arg)
                              for k in ch.i_key])
            elif ch.keyword in ["leaf", "leaf-list"]:
                ndata.append(self.base_type(ch.search_one("type")))
            modname = ch.i_module.i_modulename
            parent[nodename] = ndata