recursive problem

Hi everybody,
I was trying to create a rake task to import geo data by accessing
geonmae API's xml data , I wanna create a list of countries , cities ,
sub cities that r related to each other through nested list , anyways, I
have a problem with the recursion i made , i didn't get it , I'll list
the code hopefully i will get some help from any expert here around ,
Any help will b highly appreciated .