There should be an API to import and export an OPML file containing feeds and folders. Google reader uses the following APIs for this:
/reader/subscriptions/export
/reader/subscriptions/import
The export one is documented here and the import one is briefly mentioned here, though untested.