Each time i do
$country = $this->dom->saveXML(); // put string in country
$this->dom->save('country.xml');
It delets the old country.xml and creates a new country.xml how can i append the old content of country.xml to the new content and save it again as country.xml
Rather than trying to append it to the file, have you considered appending the new data to the existing 'old' DOM and then saving that to country.xml? This way will keep the document consistent and valid.