Use like this. replace element with your element and child.this is sample code.
$xml = new DOMDocument();
$xml_item = $xml->createElement("Item");
$xml_name = $xml->createElement("Name");
$xml_category = $xml->createElement("Category");
$xml_album->appendChild( $xml_name );
$xml_album->appendChild( $xml_category );
$xml->appendChild( $xml_album );
$xml->save("test.xml");