code: public Map<String, String> parseXmlConfiguration(final String path) {
      File xmlFile;
      xmlFile = new File(path);
      if (!xmlFile.exists()) {
        System.err.format("File %s does not exist.", path);
        return null;
      }
      DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
      DocumentBuilder docBuilder;
      try {
        docBuilder = docBuilderFactory.newDocumentBuilder();
      } catch (ParserConfigurationException e) {
        System.err.format("Failed to create instance of DocumentBuilder for file: %s. %s. %n",
            path, e.getMessage());
        return null;
      }
      Document doc;
      try {
        doc = docBuilder.parse(xmlFile);
      } catch (IOException e) {
        System.err.format("An I/O error occured reading file %s. %s.%n", path, e.getMessage());
        return null;
      } catch (SAXException e) {
        System.err.format("A parsing error occured parsing file %s. %s.%n", path, e.getMessage());
        return null;
      }
      // Optional, but recommended.
      // Refer to http://stackoverflow.com/questions/13786607/normalization-in-dom-parsing-with-java-how-does-it-work
      doc.getDocumentElement().normalize();
      Map<String, String> ret = new HashMap<>();
      NodeList propNodeList = doc.getElementsByTagName("property");
      for (int i = 0; i < propNodeList.getLength(); i++) {
        Node propNode = propNodeList.item(i);
        if (propNode.getNodeType() == Node.ELEMENT_NODE) {
          Element element = (Element) propNode;
          ret.put(element.getElementsByTagName("name").item(0).getTextContent(),
              element.getElementsByTagName("value").item(0).getTextContent());
        }
      }
      return ret;
    }
docs: Parse an xml configuration file into a map.
  
  Referred to https://www.mkyong.com/java/how-to-read-xml-file-in-java-dom-parser/
  
  @param path path to the xml file
  @return Map from property names to values