To export calendar data to a file, use csexport. The file name extension (.ics or .xml) that you specify for the output file determines which format is used.
For example, to export the calendar with the calendar ID (calid) jsmithcal in iCalendar (text/calendar MIME) format to a file named jsmith.ics:
csexport -c jsmithcal calendar jsmith.ics
To export the calendar jsmithcal in XML (text/xml MIME) format to a file named jsmith.xml:
csexport -c jsmithcal calendar jsmith.xml