public function addDocumentation(DOMElement $inputElement, $documentation)
    {
        if ($inputElement === $this) {
            $element = $this->dom->documentElement;
        } else {
            $element = $inputElement;
        }

        $doc = $this->dom->createElement('documentation');
        $cdata = $this->dom->createTextNode($documentation);
        $doc->appendChild($cdata);

        if ($element->hasChildNodes()) {
            $element->insertBefore($doc, $element->firstChild);
        } else {
            $element->appendChild($doc);
        }

        return $doc;
    }