asXML()); //echo $xml->count(); $dom = new DOMDocument('1.0'); $dom->preserveWhiteSpace = false; $dom->formatOutput = true; $dom->loadXML($xml->asXML()); $dom->encoding = "utf-8"; echo $dom->saveXML(); //print_r($dom); //$dom->save('phonebookt47.xml'); ?>