Here you can find the source of parsePairFirst(Node node)
public static Node parsePairFirst(Node node)
//package com.java2s; import java.util.Objects; import org.w3c.dom.Node; public class Main { public static Node parsePairFirst(Node node) { Objects.requireNonNull(node); if (!node.getNodeName().equalsIgnoreCase("pair")) { throw new IllegalArgumentException("Node is not pair: " + node); }/*from ww w. j a v a2 s . c o m*/ if (node.getChildNodes().getLength() != 2) { throw new IllegalArgumentException("Malformed pair: " + node); } return node.getFirstChild(); } }