Per aggiungere usa il metodo addChild():
http://www.php.net/manual/it/functio...t-addChild.phpCodice PHP:
$nuova_foto = $xml->addChild('photo');
$nuova_foto->addAttribute('link', '/foto/nuova_foto.jpg');
Per eliminare fai l'unset() del nodo:
Codice PHP:
unset($xml->photo[0]);