Editing xml via php

Hello,
I’m using this script to change the IP settings for a server application that won’t run if the xml has the version declaration tag:
<?php
$ip = getenv(“REMOTE_ADDR”) ;
$dom = new DOMDocument();
$dom->formatOutput = true;
$root = $dom->createElement(“ServerSettings”);
$dom->appendChild($root);
$IP = $dom->createElement(“IP”);
$root->appendChild($IP);
$text = $dom->createTextNode("$ip");
$IP->appendChild($text);
$Port = $dom->createElement(“Port”);
$root->appendChild($Port);
$text = $dom->createTextNode(“9875”);
$Port->appendChild($text);
print $dom->saveXML($root);
$dom->save(“ServerSettings.xml”)
?>

it echoes properly, but still adds the declaration version line on overwriting the ServerSettings file:
echo ex:
<ServerSettings>
<IP>88.8.36.147</IP>
<Port>34</Port>
</ServerSettings>
Can anyone lend me a hand? Or suggest any tutorial?