public function convert(\DOMElement $parent, TraitDescriptor $trait)
    {
        $child = new \DOMElement('trait');
        $parent->appendChild($child);

        $namespace = $trait->getNamespace()->getFullyQualifiedStructuralElementName();
        $child->setAttribute('namespace', ltrim($namespace, '\\'));
        $child->setAttribute('line', $trait->getLine());

        $child->appendChild(new \DOMElement('name', $trait->getName()));
        $child->appendChild(new \DOMElement('full_name', $trait->getFullyQualifiedStructuralElementName()));

        $this->docBlockConverter->convert($child, $trait);

        foreach ($trait->getProperties() as $property) {
            $this->propertyConverter->convert($child, $property);
        }

        foreach ($trait->getMethods() as $method) {
            $this->methodConverter->convert($child, $method);
        }

        return $child;
    }