. */ namespace SP\Domain\Export\Services; use DOMDocument; use DOMNode; use DOMXPath; /** * Trait XmlTrait */ trait XmlTrait { private static function generateHashFromNodes(DOMDocument $document): string { return sha1( array_reduce( iterator_to_array((new DOMXPath($document))->query('/Root/*[not(self::Meta)]')->getIterator()), static fn(string $carry, DOMNode $node) => $carry . $document->saveXML($node), '' ) ); } }