code: public static void copyAttributes(Map<String, String> source, Element dest) {
          for (Entry<String, String> entry : source.entrySet()) {
              dest.setAttribute(entry.getKey(), entry.getValue());
          }
      }
docs: Copy attributes from a map to a DOM node.
  
  @param source Source map.
  @param dest DOM node.