Has anybody done this?

or know of a way of doing it for free? My mates just asked me as hes broken his phone and wants to use a spare but its locked to T-mobile!

Any suggestions?