Version 2.14.0
What's Changed
Some functions I happen a lot are causing some verbosity. By adding them to the Document class, it makes it faster to do trivial stuff like e.g. Grabbing the document element or stringifying a part of the document.
document_element locator:
use VeeWee\Xml\Dom\Document;
use function VeeWee\Xml\Dom\Locator\document_element;
$doc = Document::fromXmlFile('some.xml');
$rootElement = $doc->locate(document_element());
// Since this is a common action, there is also a shortcut:
$doc->locateDocumentElement();
Stringify
use VeeWee\Xml\Dom\Document;
$doc = Document::fromXmlFile('some.xml');
// Get full XML including the XML declaration tag:
$xml = $doc->toXmlString();
// OR, get only the XML part without declaration:
$xml = $doc->stringifyDocumentElement();
// Or stringify a specific DOM node:
$xml = $doc->stringifyNode($someNode);
Full Changelog: 2.13.0...2.14.0