XML Php

#load an XML document into the DOM
$dom = new DomDocument();
$dom -> load("books.xml");
$title =  $dom -> createElement("title");
#create text nodes
$topictext =  $dom -> createTextNode("Linux");
#append the text nodes to the inner nested elements
$topic  -> appendChild($topictext);
#append the inner nested elements to the  element<br/>$title -> appendChild($topic);<br/>#append the <title> element to the root element<br/>$dom -> documentElement -> appendChild($title);<br/>#create a new enlarged xml document<br/>$dom -> save("newbooks.xml");<br/>?> </code> </div> </div> <br /> <footer class="py-12 bg-dark"> <div class="container"> <div class="row mb-12"> <div class="col-md-12"> <p class="text-center text-black">Copyright © Mega Code Archive 2025</p> </div> </div> <div class="row mb-12"> <div class="col-md-2"> <div class="row"> .NET </div> <div class="row"> <a href="/Page/Categories/2/ASP Net">ASP.Net</a> </div> <div class="row"> <a href="/Page/Categories/3/ASP Net Tutorial">ASP.Net Tutorial</a> </div> <div class="row"> <a href="/Page/Categories/6/C#">C#</a> </div> <div class="row"> <a href="/Page/Categories/7/C# Book">C# Book</a> </div> <div class="row"> <a href="/Page/Categories/8/C# by API">C# by API</a> </div> <div class="row"> <a href="/Page/Categories/9/C# Tutorial">C# Tutorial</a> </div> <div class="row"> <a href="/Page/Categories/38/VB Net">VB.Net</a> </div> <div class="row"> <a href="/Page/Categories/39/VB Net by API">VB.Net by API</a> </div> <div class="row"> <a href="/Page/Categories/40/VB Net Tutorial">VB.Net Tutorial</a> </div> <div class="row"> <a href="/Page/Categories/41/Visual CPlusPlus Net">Visual C++ .Net</a> </div> <div class="row"> <a href="/Page/Categories/42/VisualBasic Script">VisualBasic Script</a> </div> </div> <div class="col-md-2"> <div class="row"> Java </div> <div class="row"> <a href="/Page/Categories/15/Java">Java</a> </div> <div class="row"> <a href="/Page/Categories/16/Java Book">Java Book</a> </div> <div class="row"> <a href="/Page/Categories/17/Java by API">Java by API</a> </div> <div class="row"> <a href="/Page/Categories/18/Java Tutorial">Java Tutorial</a> </div> <div class="row"> Script </div> <div class="row"> <a href="/Page/Categories/13/Flash ActionScript">Flash ActionScript</a> </div> <div class="row"> <a href="/Page/Categories/14/Flex">Flex</a> </div> <div class="row"> <a href="/Page/Categories/19/JavaScript DHTML">JavaScript DHTML</a> </div> <div class="row"> <a href="/Page/Categories/20/JavaScript Reference">JavaScript Reference</a> </div> <div class="row"> <a href="/Page/Categories/21/JavaScript Tutorial">JavaScript Tutorial</a> </div> </div> <div class="col-md-2"> <div class="row"> Database </div> <div class="row"> <a href="/Page/Categories/25/MSSQL">MSSQL</a> </div> <div class="row"> <a href="/Page/Categories/26/MSSQL Tutorial">MSSQL Tutorial</a> </div> <div class="row"> <a href="/Page/Categories/27/MySQL">MySQL</a> </div> <div class="row"> <a href="/Page/Categories/28/MySQL Tutorial">MySQL Tutorial</a> </div> <div class="row"> <a href="/Page/Categories/29/Oracle PLSQL">Oracle PLSQL</a> </div> <div class="row"> <a href="/Page/Categories/30/Oracle PLSQL Tutorial">Oracle PLSQL Tutorial</a> </div> <div class="row"> <a href="/Page/Categories/33/PostgreSQL">PostgreSQL</a> </div> </div> <div class="col-md-2"> <div class="row"> Languages </div> <div class="row"> <a href="/Page/Categories/1/Android">Android</a> </div> <div class="row"> <a href="/Page/Categories/4/C">C</a> </div> <div class="row"> <a href="/Page/Categories/5/C Tutorial">C Tutorial</a> </div> <div class="row"> <a href="/Page/Categories/10/CPlusPlus">C++</a> </div> <div class="row"> <a href="/Page/Categories/11/CPlusPlus Tutorial">C++ Tutorial</a> </div> <div class="row"> <a href="/Page/Categories/12/Delphi">Delphi</a> </div> <div class="row"> <a href="/Page/Categories/31/Perl">Perl</a> </div> <div class="row"> <a href="/Page/Categories/32/PHP">PHP</a> </div> <div class="row"> <a href="/Page/Categories/34/Python">Python</a> </div> <div class="row"> <a href="/Page/Categories/35/Python Tutorial">Python Tutorial</a> </div> <div class="row"> <a href="/Page/Categories/36/Ruby">Ruby</a> </div> <div class="row"> <a href="/Page/Categories/37/Silverlight">Silverlight</a> </div> </div> <div class="col-md-2"> <div class="row"> Office </div> <div class="row"> <a href="/Page/Categories/22/MSOfficeExcel 2007 Tutorial">MSOfficeExcel 2007 Tutorial</a> </div> <div class="row"> <a href="/Page/Categories/23/MSOfficePowerPoint 2007 Tutorial">MSOfficePowerPoint 2007 Tutorial</a> </div> <div class="row"> <a href="/Page/Categories/24/MSOfficeWord 2007 Tutorial">MSOfficeWord 2007 Tutorial</a> </div> <div class="row"> Data </div> <div class="row"> <a href="/Page/Categories/43/XML">XML</a> </div> <div class="row"> <a href="/Page/Categories/44/XML Tutorial">XML Tutorial</a> </div> </div> <div class="col-md-2"> <div class="row"> Others </div> <div class="row"> <a href="/Home/About">About</a> </div> </div> </div> </div> </footer> </div> </body> </html>