Share their own levels with friends? Have you ever tried opening some map files of some games? For some games, they just store map's data in XML format while some older games, they might use INI format. This all depends on them.
Firstly, you possibly need to create your own level parser, and you will possibly be the one who design and decide of all the format and what not. When your app parses the file, it should decide which code does what and which object goes where on a map in the game, possibly in the beginning of the layout, etc. Also, do you want the map to be able to hold some logic too? (ex. if player enters a certain area, what happened?) If so, your event sheets must be designed to be flexible and applicable with all these user-generated contents.
Transferring a level from one machine to another would be similar to transferring a file. Back when Internet is still slow and sluggish and less interactive, players just download map files (made by other people) online, place these files in the game's folder, then load them up in the game. But of course, many games these days download new maps, etc. automatically, place them in the right place, and the player will just see all the new maps updated and selectable in their game. The idea is the same, but just automated. (Alternatively, some online games stream a map from a server and load it up without saving any file on the device.)
I think you gotta go down and dirty for this, unless there are some magnificent plugin/tools/engine out there that I am not aware of that could help you further a bit. Have you check out for something like this in the Scirra Store?