appendChild($document->createElement("items")); $item = $root->appendChild($document->createElement("item")); $item->appendChild($document->createTextNode("Rake & fork")); echo $document->saveXML();