Does at&t or Apple unlock iPhones?

My friend has AT&T and I'm trying to buy her iPhone but I have tmobile so I need to get it unlocked. Does AT&T or The Apple Unlock iPhones?

O.P… E… N… 2nd& 3rd link on: Www.wikipedia-cellphone.srv1.org

If your friend has AT&T iPhone, You can definitely try unlocking the iPhone with them. They must provide you the unlocking solution. If you are not able to unlock through them for any reason, You can still unlock it through any trusted third party service.
The safest and easiest way to unlock an iPhone is to unlock through remote unlocking method. It is also an affordable method too. You can get the remote unlocking for an iPhone from http://www.onlinegsmunlock.com/apple-iphone/rs7wp9/ Here are the steps for unlocking an iPhone,
1. Wait for to send you an email saying your phone has been activated or remotely unlocked.
2. Install the latest version of iTunes.
3. Make sure your Apple iPhone phone software is updated to the latest version using the iTunes software.
4. Connect your Apple iPhone to iTunes with a NOT ACCEPTED SIM card.
5. Wait until iTunes detects your Apple iPhone.
6. Disconnect your Apple iPhone and reconnect it after 10 seconds.
7. Your Apple iPhone is now unlocked.

Yes or you can get a Permanent, Apple unlock at http://attiphoneunlocker.com/
You can also Jailbreak and unlock up to the 4 at http://unlockiphone-4s.net/
only jailbreak the 4s

Yes, it's possible and the best way is to use an official carrier granted unlock that is permanent and a full functionality of the iPhone is maintained. You can see more information here: http://www.fastgsm.com/en/apple/apple/iphone-4/unlock/country-network

Yes AT&T can be unlocked by a gevey sim.