addChild('server');
$server->addAttribute('id', (string) $i);
if(strlen($name) == 0) $name = $host;
$server->addChild('name', (string)$name);
$server->addChild('host', (string)$host);
$server->addChild('port', (string)$port);
$servers->asXML($filename);
}
function parser()
{
//TODO : Fix errors when no valid XML content inside file.
$file = "servers.xml";
if(file_exists($file))
{
$servers = file_get_contents("servers.xml");
if (trim($servers) == '') //File exists but empty
{
$content = "