Node[] (@NotNull Node arrayNode) { List<Node> entryList = new ArrayList<>(); NodeList children = arrayNode.getChildNodes(); for (int i = 0; i < children.getLength(); i ++) { Node child = children.item(i); if (child.getNodeType() == Node.ELEMENT_NODE) { entryList.add(child); } } return entryList.toArray(new Node[0]); }