startElement("message-number", attributes);
characters(String.valueOf(message.getMessageNumber()));
endElement("message-number");
// FLAGS:
Flags flags = message.getFlags();
Flags.Flag[] sf = flags.getSystemFlags();
// get the system flags
attributes.clear();
for (int i = 0; i < sf.length; i++) {
Flags.Flag flag = sf[i];
if (flag == Flags.Flag.ANSWERED) {
addAttribute("answered", "yes");
} else if (flag == Flags.Flag.DELETED) {
addAttribute("deleted", "yes");
} else if (flag == Flags.Flag.DRAFT) {
addAttribute("draft", "yes");
} else if (flag == Flags.Flag.FLAGGED) {
addAttribute("flagged", "yes");
} else if (flag == Flags.Flag.RECENT) {
addAttribute("recent", "yes");
} else if (flag == Flags.Flag.SEEN) {
addAttribute("seen", "yes");
}
}
startElement("flags", attributes);
endElement("flags");
String[] uf = flags.getUserFlags();
// get the user flag strings
for (int i = 0; i < uf.length; i++) {
attributes.clear();
startElement("user-flags", attributes);
characters(uf[i]);