I remember reading that flashing the firmware unlocks it. Not sure if it's true because I have never tried.
Just like before you jailbreak you would flash the firmware.
If you buy a 5S from virgin mobile to use as unlocked, ensure that virgin mobile doesn't fall under sprint USA's rules where you can unlock it, but only for international use (not usable with US based gsm networks)if you buy a verizon USA or Cellcom iPhone 5, 5C, 5S those can be used on US gsm carriers and ship already unlocked out of the box. If virgin mobile iPhone can work with gsm networks in the US, then this is a great deal. Ago just to add, if using an unlocked 5C or 5S on any gsm carrier, if the carrier Cary's the iPhone, all features will work. The only difference for carriers is found with the iPhone 5 a1429 and a1428 as they support different LTE bands whereas the 5S in the US is the same all carriers, but the 5C model number varys for each carrier, but still supports the same frequencies.
Please help me, I live in France and the 5S costs 700€ that is $980 ! Such a huge difference. So for example if i bye this 5S how much to unlock it in order to use in france. Thank you