class DOMParserUtil {

    public static Map<Node, List<Node>> getNestedChildrenNodesMap(Document document, String mainContainerNodeName, String containerNodeName, String childNodeName) {
        Map<Node, List<Node>> toReturn = new HashMap<>();
        asStream(document.getElementsByTagName(mainContainerNodeName))
                .map(mainContainerNode -> getChildrenNodesMap(mainContainerNode, containerNodeName, childNodeName))
                .forEach(toReturn::putAll);
        return toReturn;
    }

    private  DOMParserUtil();

}