encodeInvite(ie, lc, null, inv, fields, true);
encodeInvite(ie, lc, appt, inv, fields, false);
    private static Element encodeInvitesForMessage(Element parent, ZimbraContext lc, Message msg, int fields)    throws ServiceException {        if (fields != NOTIFY_FIELDS)            if (!needToOutput(fields, Change.MODIFIED_INVITE))                return parent;                Element ie = parent.addElement(MailService.E_INVITE);                boolean addedMethod = false;        Mailbox mbox = msg.getMailbox();                for (Iterator iter = msg.getApptInfoIterator(); iter.hasNext(); ) {            Message.ApptInfo info = (Message.ApptInfo) iter.next();                        Appointment appt = null;            try {                appt = mbox.getAppointmentById(lc.getOperationContext(), info.getAppointmentId());            } catch (MailServiceException.NoSuchItemException e) {}            if (appt != null) {                Invite inv = appt.getInvite(msg.getId(), info.getComponentNo());                                if (inv != null) {                    if (!addedMethod) {//                        ie.addAttribute("method", inv.getMethod());                        addedMethod = true;                    }                    encodeTimeZoneMap(ie, appt.getTimeZoneMap());                    encodeInvite(ie, lc, null, inv, fields, true); // NULL b/c we don't want to encode all of the reply-status here!                } else {                    // invite not in this appointment anymore                }            } else {                // couldn't find appointment            }                    }                return ie;    }