Concrete5 Countries Helper works together with Zend Locale library.
Version 1 of php country list generator using a foreach loop, looks like the following code:
$strSelectCountry = Loader::helper('form')->select(
'country', // name
$arCountries, // array created by getCountries()
'', // value selected, if comes from post var
array('style'=>'width: 100%') // css styles & tagAttributes
// Here is an example of list conversion, from xml into js string, you can even use this from a json file
var arCountries = 'Afghanistan,Andorra,Angola,....'
var strCountries = ''...
// bPostFrm cames from $_POST php array and is set true or false