$doc = new DOMDocument(); $doc->load('products.xml'); $doc->xinclude();
$doc = new DOMDocument(); $doc->load('mydocument.xml'); $doc->xinclude();In this code, we load the mydocument.xml file, which contains xinclude directives that reference external XML files. We then call the xinclude() method to include these files in the document. The DOMDocument class is part of the PHP standard library and does not require any additional package or library to use.