Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
// License as published by the Free Software Foundation; either

import java.util.Set;

import org.w3c.dom.Node;

public class Main {
    public static Node findElementByTag(Set<Node> nodes, String tag) {
        Node result = null;

        for (Node child : nodes) {
            if (tag.equals(child.getNodeName())) {
                result = child;
                break;
            }
        }

        return result;
    }
}