Nodes Document - ThomasWeinert/FluentDOM GitHub Wiki
The FluentDOM\Nodes::$document
property provides access to the associated
DOMDocument
. By default this will be a FluentDOM\DOM\Document
instance, but it
depends on how you created the FluentDOM\Nodes
instance.
$fd = new FluentDOM\Nodes();
$fd->document->appendChild(
$fd->document->createElement('example')
);
echo $fd;
Output:
<?xml version="1.0" encoding="UTF-8"?>
<example/>