Get all matching child nodes
@param parentNode - the parent node
@param name - name of child node to match
@param value - value of child node to match, specify null to not match value
@return matching child nodes
423222
private static List<Node> getChildren(Node parentNode, String name, String value){
                List<Node> childNodes = new ArrayList<Node>();
                if(parentNode == null || name == null){
                        return childNodes;
                }

                if (parentNode.getNodeType() == Node.ELEMENT_NODE && parentNode.hasChildNodes()) {
                        NodeList children = parentNode.getChildNodes();
                        for(int i=0; i < children.getLength(); i++){
                                Node child = children.item(i);
                                if(child != null && name.equals(child.getNodeName()) && (value == null || value.equals(child.getTextContent()))){
                                        childNodes.add(child);
                                }
                        }
                }

                return childNodes;
        }
81958
public static Element getChildElement(Element parent, String tagName) {
        List<Element> children = getChildElements(parent, tagName);

        if (children.isEmpty()) {
            return null;
        } else {
            return children.get(0);
        }
    }
1360447
def get_child(self, value):
        
        for node in self.children:
            if node.value == value:
                return node

        return None
541961
public AiNode findNode(String name) {
        /* classic recursive depth first search */
        
        if (m_name.equals(name)) {
            return this;
        }
        
        for (AiNode child : m_children) {
            if (null != child.findNode(name)) {
                return child;
            }
        }
        
        return null;
    }
397059
@Override
    public Node getChildNode(String childNodeId)
    {
        NodeLink link = new NodeLink(getNodeId(), childNodeId);

        if (this.children == null)
        {
            return null;
        }
        else
        {
            return this.children.get(link);
        }
    }
553186
def get_child_values(parent, names):
        
        vals = []
        for name in names:
            if parent.hasElement(name):
                vals.append(XmlHelper.as_value(parent.getElement(name)))
            else:
                vals.append(np.nan)
        return vals
1232035
private void addChildNode(final Builder builder, final String name, final Object value) {
        assert !(value instanceof List);

        final Builder childBuilder = new Builder();
        // Set the name of the child node.
        childBuilder.name(name);
        // Set the value of the child node.
        final ImmutableNode childNode = toNode(childBuilder, value);
        // Add the node to the children of the node being built.
        builder.addChild(childNode);
    }
771612
public NodeConfig getChildNodeByName(String name) {
		if (name == null) {
			throw new NullPointerException("Node name is null");
		}
		if (childrenNodes != null && childrenNodes.size() > 0) {
			for (NodeConfig childNode : childrenNodes) {
				if (childNode.getName().equals(name)) {
					return childNode;
				}
			}
		}
		return null;
	}
1030765
public static List<Element> getChildren(Element parent, String childName) {
		ArrayList<Element> children = new ArrayList<Element>();
		NodeList nodes = parent.getChildNodes();
		for (int i = 0; i < nodes.getLength(); ++i) {
			Node node = nodes.item(i);
			if ((node instanceof Element) && node.getNodeName().equals(childName))
				children.add((Element)node);
		}
		return children;
	}
784697
@Override
    public Xml child(String name) {
        List<Xml> children = children(name);
        if (children.size() != 1) {
            logger.debug("Could not find individual child node: " + name);
            return new XmlAbsent(name);
        }
        return children.get(0);
    }
735086
public static Element getChild(Element parent, String childName) {
		NodeList nodes = parent.getChildNodes();
		for (int i = 0; i < nodes.getLength(); ++i) {
			Node node = nodes.item(i);
			if ((node instanceof Element) && node.getNodeName().equals(childName))
				return (Element)node;
		}
		return null;
	}
798575
public static Element getChild( Element root, String name )
    {
        if( null == root )
        {
            return null;
        }
        NodeList list = root.getElementsByTagName( name );
        int n = list.getLength();
        if( n < 1 )
        {
            return null;
        }
        return (Element) list.item( 0 );
    }
1090337
function findNode(name, root) {
        var i, stack, node;
        if (root === null || root === undefined) { return null; }
        stack = [root];
        while (stack.length > 0) {
            node = stack.pop();
            if (node.name === name) {
                return node;
            }
            for (i = node.children.length - 1; i >= 0; i -= 1) {
                stack.push(node.children[i]);
            }
        }
        return null;
    }
561259
public XNElement childElement(String name, String namespace) {
        for (XNElement e : children) {
            if (Objects.equals(e.name, name) && Objects.equals(e.namespace, namespace)) {
                return e;
            }
        }
        return null;
    }
68507
public static List<String> get(String name, @Nullable Boolean value) {
    if (value != null) {
      if (value) {
        return Collections.singletonList("--" + name);
      }
      return Collections.singletonList("--no-" + name);
    }
    return Collections.emptyList();
  }
721008
public CallTreeNode getOrAddChild(String name) {
		CallTreeNode child = getChild(name);
		if (child == null) {
			child = addChild(name);
		}
		return child;
	}
503576
function getNodesByNameHelper(childArray, name) {
  let nodes = [].concat(childArray.filter(element => element.name === name));
  let otherNodes = [];
  childArray.forEach(node => {
    if (hasChildren(node)) {
      otherNodes = otherNodes.concat(getNodesByNameHelper(node.children, name));
    }
  });
  return nodes.concat(otherNodes);
}