String id = invoke(req).getElement(MailService.E_SEARCH).getAttribute(MailService.A_ID);  return getSearchFolderById(id);
Element newSearchEl = invoke(req).getElement(MailService.E_SEARCH); ZSearchFolder newSearch = getSearchFolderById(newSearchEl.getAttribute(MailService.A_ID)); return newSearch != null ? newSearch : new ZSearchFolder(newSearchEl, null);
    public ZSearchFolder createSearchFolder(String parentId, String name,                 String query, String types, SearchSortBy sortBy, ZFolder.Color color) throws ServiceException {        XMLElement req = new XMLElement(MailService.CREATE_SEARCH_FOLDER_REQUEST);        Element folderEl = req.addElement(MailService.E_SEARCH);        folderEl.addAttribute(MailService.A_NAME, name);        folderEl.addAttribute(MailService.A_FOLDER, parentId);        folderEl.addAttribute(MailService.A_QUERY, query);        if (color != null) folderEl.addAttribute(MailService.A_COLOR, color.getValue());        if (types != null) folderEl.addAttribute(MailService.A_SEARCH_TYPES, types);        if (sortBy != null) folderEl.addAttribute(MailService.A_SORTBY, sortBy.name());        String id = invoke(req).getElement(MailService.E_SEARCH).getAttribute(MailService.A_ID);        // this assumes notifications will create the folder        return getSearchFolderById(id);    }