public static TreeNode[] children(TreeNode node) {
		TreeNode[] children = new TreeNode[node.getChildCount()];
		if (!node.isLeaf()) {
			int i = 0;
			Enumeration enumer = node.children();
			while (i < children.length)
				children[i++] = (TreeNode) enumer.nextElement();
		}
		return children;
	}