class SchedulerAdapter {

    public XmlBuilder getSchedulerCalendarNamesToXml(Scheduler theScheduler) {
        XmlBuilder xbRoot = new XmlBuilder("schedulerCalendars");

        try {
            List<String> names = theScheduler.getCalendarNames();

            for (int i = 0; i < names.size(); i++) {
                XmlBuilder el = new XmlBuilder("calendar");

                el.setValue(names.get(i));
                xbRoot.addSubElement(el);
            }
        } catch (SchedulerException se) {
            log.error(se.toString());
        }
        return xbRoot;
    }

}