public static void main(String[] args) throws ParserConfigurationException, SAXException, IOException, XPathExpressionException { // DocumentBuilderFactory domFactory = DocumentBuilderFactory // .newInstance(); // domFactory.setNamespaceAware(true);…