I need to update the country list of my website and I want to automate the process. Country list can be found here

In that XML file they have given the data is in following format
<ISO_3166-1_Entry> <ISO_3166-1_Country_name>AFGHANISTAN</ISO_3166-1_Country_name>

I need to read the XML file and get the data then write this in a PHP file in following format. (I prefer the DOM method)
$countries["AF"] = "Afghanistan";
$countries["AL"] = "Albania";
$countries["DZ"] = "Algeria";

Any help in this regards is much appreciated.