Here you can find the source of getNodeList(Node node, String tagName)
public static NodeList getNodeList(Node node, String tagName)
//package com.java2s; /*// ww w . j a v a 2 s .c om * ??? ????????? ? ??? ???????? ?????????? ??????? ? ?????????? ??????? * * ???????? ? 2010-2016, CompuProject ?/??? ???????? ????????. * ???? ????? ????????. * * ShopImportDeamon ???? ??????????? ???????????? ???????????????? ? ????????????? * CompuProject ? ?????? ??????? ApelsinShop ??? ????? ???? ?????????? ?????????. * * ?????????????????, ?????????????? ?????????? ???? ? ????? ????? ?/??? ??? * ???????????? ????????????? ??? ????????, ??? ?????????????? ?????????? ?????????: * * 1. ??? ????????????????? ?????????? ???? ?????? ????????????? ????????? ???? * ??????????? ?? ?????????? ??????, ????? ???????? ???????? ? ???????????? * ????? ?? ????????. * * 2. ??? ????????? ?????????? ???? ?????? ????????????? ????????? ???? * ??????????? ?? ?????????? ??????, ????? ???????? ????????, ???????????? * ????? ?? ???????? ? ??????? ? ?????????? ???????????. * * 3. ????????????????? ?/??? ????????? ?????????? ???? ?????? ???????????? * ?? ?????????? ??????????? ????????????? ???????? GNU ? ??? ????, ? ????? * ??? ???? ???????????? ?????? ??????????? ???????????? ?????????????; * ???? ???????? ??????? 3, ???? (?? ?????? ??????) ????? ????? ??????? * ???????. ?? ?????? ???? ???????? ????? ??????????? ????????????? * ???????? GNU ??????? ?? ????? ??????????. ????? ???? ?? ???, ???. * <http://www.gnu.org/licenses/>. * * ShopImportDeamon ????????????????????? ? ???????, ??? ??? ????? ????????, * ?? ???? ?????? ???????????; ???? ??? ???????? ???????? ??????????? ????? * ??? ???????????? ??? ?????????????? ?????. ????????? ???. ? ??????????? * ????????????? ???????? GNU. * * ??? ??? ?????? ???????? ??????, ??? ??????????? ??? CompuProject ??? * ?????? ????????????????? ??? ?????? ???? ??????, ???????????, ???????????, * ??????, ?????????? ??? ?????? ???? ?????? ?????? (????????, ??? ??? * ???????????????? ?????????????? ??? ????????? ???????? ? ?????; ??????? * ????????? ??? ???????; ?????????????????? ?????????). * * ??????????????? ?????????? ?????????? ????? ???????????, ??? ?? ???? ??????????????? * ?? ????? ?????????, ??????????????? ? ?????????, ?????????????? ????, ?????????? ? ????? * ? ?????????? ?? ??????????. * * ???? ?? ??? ?????????? ? ?????????????????? ?????????, ??????????????? ? ?????????, * ?? ?? ?????? ???????????? ?? ??????????????? ?????????? ?????????? ?????. * */ import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static NodeList getNodeList(Node node, String tagName) { return getNodeList(NodeToElement(node), tagName); } public static NodeList getNodeList(Element element, String tagName) { return element.getElementsByTagName(tagName); } public static Element NodeToElement(Node node) { if (node.getNodeType() == Node.ELEMENT_NODE) { return (Element) node; } return null; } }