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

      REXML::Element.new("trace").tap do |trace|
        @attributes.each {|attribute| trace.elements << attribute.format if attribute.formattable?}
        @events.each {|event| trace.elements << event.format if event.formattable?}
      end
    end
def format
      raise FormatError.new(self) unless formattable?

      REXML::Element.new("trace").tap do |trace|
        @attributes.each {|attribute| trace.elements << attribute.format if attribute.formattable?}
        @events.each {|event| trace.elements << event.format if event.formattable?}
      end
    end
Format as a XML element.

 @return [REXML::Element]
   XML element
 @raise FormatError