UPDATE: In Spring '12, Role Hierarchies were added to the MetaData API, so you can use changesets or your IDE of choice to migrate role hierarchy changes. No need for this whole mess!!! Stop reading!! :)
Apex Data Loader

UPDATE: In Spring '12, Role Hierarchies were added to the MetaData API, so you can use changesets or your IDE of choice to migrate role hierarchy changes. No need for this whole mess!!! Stop reading!! :)