public function getDocument()
    {
        if (!$this->valid) {
            return false;
        } elseif ($this->document) {
            return $this->document;
        } else {
            $this->document = new DOMDocument('1.0', 'UTF-8');
            $this->document->strictErrorChecking = false;
            $this->document->formatOutput = false;

            return $this->document;
        }
    }