docs: public void writeMapToXML(final Map<String, Set<String>> m) {
          final File outputFile = new File(job.tempDir, FILE_NAME_PLUGIN_XML);
          if (m == null) {
              return;
          }
          final Properties prop = new Properties();
          for (Map.Entry<String, Set<String>> entry : m.entrySet()) {
              final String key = entry.getKey();
              final String value = StringUtils.join(entry.getValue(),
                      COMMA);
              prop.setProperty(key, value);
          }
          //File outputFile = new File(tempDir, filename);
  
          final DocumentBuilder db = XMLUtils.getDocumentBuilder();
          final Document doc = db.newDocument();
          final Element properties = (Element) doc.appendChild(doc
                  .createElement("properties"));
  
          final Set<Object> keys = prop.keySet();
          for (Object key1 : keys) {
              final String key = (String) key1;
              final Element entry = (Element) properties.appendChild(doc
                      .createElement("entry"));
              entry.setAttribute("key", key);
              entry.appendChild(doc.createTextNode(prop.getProperty(key)));
          }
          final TransformerFactory tf = TransformerFactory.newInstance();
          Transformer t;
          try {
              t = withLogger(tf.newTransformer(), logger);
              t.setOutputProperty(OutputKeys.INDENT, "yes");
              t.setOutputProperty(OutputKeys.METHOD, "xml");
              t.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
          } catch (final TransformerConfigurationException tce) {
              throw new RuntimeException(tce);
          }
          final DOMSource doms = new DOMSource(doc);
          OutputStream out = null;
          try {
              out = new FileOutputStream(outputFile);
              final StreamResult sr = new StreamResult(out);
              t.transform(doms, sr);
          } catch (final Exception e) {
              logger.error("Failed to process map: " + e.getMessage(), e);
          } finally {
              if (out != null) {
                  try {
                      out.close();
                  } catch (final IOException e) {
                      logger.error("Failed to close output stream: " + e.getMessage());
                  }
              }
          }
      }