<?xml version="1.0"?>
<contacts>
<contact>
<person>Adam</person>
<addredd>Eva street</person>
<ph>111</ph>
</contact>
<contact>
<person>Adam</person><person>John</person>
<person>Thomas street</person>
<ph>222</ph>
</contact>
<contact>
<person>Thomas</person>
<address>John street</address>
<ph>333</ph
</contact>
</contacts>
and i want to add a new "contact" element and its sub elements(person,address,ph)with their text values to this xml file using php,lets say that i start with this:
<?php
$xml = new DomDocument();
$xml->preserveWhitespace = false;
$xml->load('contacts.xml');
what is next=>?
give me exact code for answer