code: public void printXMLElement(String name, Map<String, String> attributes)
      {
          Element element = new DefaultElement(name);
  
          if (attributes != null && !attributes.isEmpty()) {
              for (Map.Entry<String, String> entry : attributes.entrySet()) {
                  element.addAttribute(entry.getKey(), entry.getValue());
              }
          }
  
          try {
              this.xmlWriter.write(element);
          } catch (IOException e) {
              // TODO: add error log here
          }
      }
docs: Print the xml element. In the form {@code <name att1="value1" att2="value2"/>}.
  
  @param name the xml element to print
  @param attributes the xml attributes of the element to print