This is an article on the InterSystems FAQ site.
1. Export API
a. Use $system.OBJ.Export()
to specify individual routines to export. For example:
do $system.OBJ.Export("TEST1.mac,TEST2.mac","c:\temp\routines.xml",,.errors)
The format to specify is routine name.extension, and the extension is mac, bas, int, inc, obj.
Errors during export are stored in errors.