def format
      raise FormatError.new(self) unless formattable?

      REXML::Element.new("log").tap do |log|
        log.attributes["xes.version"] = @xes_version.to_s if @xes_version
        log.attributes["xes.features"] = @xes_features.to_s if @xes_features
        log.attributes["openxes.version"] = @openxes_version.to_s if @openxes_version
        log.attributes["xmlns"] = @xmlns.to_s if @xmlns
        @extensions.each {|ext| log.elements << ext.format if ext.formattable?}
        @classifiers.each {|classifier| log.elements << classifier.format if classifier.formattable?}
        log.elements << @event_global.format if @event_global.formattable?
        log.elements << @trace_global.format if @trace_global.formattable?
        @attributes.each {|attribute| log.elements << attribute.format if attribute.formattable?}
        @traces.each {|trace| log.elements << trace.format if trace.formattable?}
      end
    end
def format
      raise FormatError.new(self) unless formattable?

      REXML::Element.new("log").tap do |log|
        log.attributes["xes.version"] = @xes_version.to_s if @xes_version
        log.attributes["xes.features"] = @xes_features.to_s if @xes_features
        log.attributes["openxes.version"] = @openxes_version.to_s if @openxes_version
        log.attributes["xmlns"] = @xmlns.to_s if @xmlns
        @extensions.each {|ext| log.elements << ext.format if ext.formattable?}
        @classifiers.each {|classifier| log.elements << classifier.format if classifier.formattable?}
        log.elements << @event_global.format if @event_global.formattable?
        log.elements << @trace_global.format if @trace_global.formattable?
        @attributes.each {|attribute| log.elements << attribute.format if attribute.formattable?}
        @traces.each {|trace| log.elements << trace.format if trace.formattable?}
      end
    end
Format as a XML element.

 @return [REXML::Element]
   XML element
 @raise FormatError
   format error when the log is formattable