private function generateTypeXml(ASTClass $type, $typeIdentifier)
{
if (!$type->isUserDefined()) {
return;
}
$xml = end($this->xmlStack);
$doc = $xml->ownerDocument;
$typeXml = $doc->createElement($typeIdentifier);
$typeXml->setAttribute('name', Utf8Util::ensureEncoding($type->getName()));
$typeXml->setAttribute('start', Utf8Util::ensureEncoding($type->getStartLine()));
$typeXml->setAttribute('end', Utf8Util::ensureEncoding($type->getEndLine()));
$this->writeNodeMetrics($typeXml, $type);
$this->writeFileReference($typeXml, $type->getCompilationUnit());
$xml->appendChild($typeXml);
array_push($this->xmlStack, $typeXml);
foreach ($type->getMethods() as $method) {
$method->accept($this);
}
foreach ($type->getProperties() as $property) {
$property->accept($this);
}
array_pop($this->xmlStack);
}