code: 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;
          }
docs: 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