public static List<Element> getChildren(Element spec) {
        List<Element> children = new ArrayList<>();
        if (spec == null) {
            return children;
        }

        NodeList childNodes = spec.getChildNodes();
        for (int i = 0; i < childNodes.getLength(); i++) {
            Node child = childNodes.item(i);
            if (child instanceof Element) {
                children.add((Element) child);
            }
        }
        return children;
    }
Returns the child Element objects from a w3c dom spec.

@return List of elements. Empty list (never null) if none found or if the given element is null
vespajlib/src/main/java/com/yahoo/text/XML.java