the XML dom parser is called tree-based parser which transform an xml document into a tree structure. using it we can easily work with xml nodes (element, attributes).

this below xml file will be used in our examples:

              // demo.xml

     <?xml    version="1.0"    encoding= "utf-8" ?>
               <item  type = "microchip">

load xml

first we create an xml dom object using domdocument() method

the php load() method is used to loads an xml document.

                $xdoc = new domdocument();
                $xdoc->load( "soft.xml");
                print $xdoc->savexml();

the output of the code above:

sata23 1234.1234 220333