Java tutorial
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { /** * Return array of children nodes */ public static Node[] childrenArray(Node node) { NodeList list = node.getChildNodes(); Node[] children = new Node[list.getLength()]; for (int i = 0; i < children.length; i++) { children[i] = list.item(i); } return children; } }