Here you can find the source of parseStringList(Node node)
public static List<String> parseStringList(Node node)
//package com.java2s; import java.util.ArrayList; import java.util.List; import java.util.Objects; import org.w3c.dom.Node; public class Main { public static List<String> parseStringList(Node node) { List<Node> nodes = parseList(node); List<String> strings = new ArrayList<>(nodes.size()); for (Node child : nodes) { strings.add(parseString(child)); }//from ww w.j a v a2 s. co m return strings; } public static List<Node> parseList(Node node) { Objects.requireNonNull(node); if (!node.getNodeName().equalsIgnoreCase("list")) { throw new IllegalArgumentException("Node is not list: " + node); } int n = node.getChildNodes().getLength(); List<Node> nodes = new ArrayList<>(n); for (int i = 0; i < n; i++) { nodes.add(node.getChildNodes().item(i)); } return nodes; } public static String parseString(Node node) { Objects.requireNonNull(node); if (!node.getNodeName().equalsIgnoreCase("string")) { throw new IllegalArgumentException("Node is not string: " + node); } return node.getTextContent(); } }