code: private void run(XmlOperation operation) throws ReportException {
          try {
              operation.run();
          } catch (XMLStreamException | IOException e) {
              throw new ReportException("Cannot write to XML report.", e);
          }
      }
docs: Defines an operation to write XML elements.
  
  @param operation
  The operation.
  @throws ReportException
  If writing fails.