public function __construct(\DOMDocument $document, $metadata = null) { $this->document = $document; $this->metadata = $metadata; }