Here you can find the source of getChildNodes(final Node node)
public static List<Node> getChildNodes(final Node node)
//package com.java2s; //License from project: Open Source License import java.util.List; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import com.google.common.collect.Lists; public class Main { public static List<Node> getChildNodes(final Node node) { final NodeList list = node.getChildNodes(); final List<Node> result = Lists.newArrayList(); for (int i = 0; i < list.getLength(); i++) { final Node child = list.item(i); result.add(child);/*from w ww . j av a 2 s. c o m*/ } return result; } }