$quote = $dom->createElement('quote'); //Create a 'stump' for quote$quote->setAttribute('year', $_POST['year']); //Set Attribute for year$phrase = $dom->createElement('phrase'); //Create a 'branch' for phrase$phraseText = $dom->createTextNode($_POST['quote']); //Create a 'leaf' for quote$phrase->appendChild($phraseText); //Assign to the 'leaf'$author = $dom->createElement('author'); //Create a 'branch' for author$authorText = $dom->createTextNode($_POST['author']); //Create a 'leaf' for author$author->appendChild($authorText); //Assign to the 'leaf'$quote->appendChild($phrase); //Assign the 'branch' to the 'stump'$quote->appendChild($author); //Assign the 'branch' to the 'stump'$dom->documentElement->appendChild($quote); //Assign the 'stump' to the 'ground'