Date date = new Date();
  public Element toElement(Branch parent) {     Element root = parent.addElement("FindBugsSummary");     DateFormat df = new SimpleDateFormat( "EEE, d MMM yyyy HH:mm:ss Z" );     root.addAttribute("timestamp", df.format(date ));     root.addAttribute( "total_classes", String.valueOf( totalClasses ) );     root.addAttribute( "total_bugs", String.valueOf( totalErrors ) );     root.addAttribute( "num_packages", String.valueOf( packageStatsMap.size() ) );     Iterator<PackageStats> i = packageStatsMap.values().iterator();     while( i.hasNext() ) {       PackageStats stats = i.next();       stats.toElement( root );     }      return root;  }