private function getContributorXML($contributor) { $contributor_xml = ''; if ($contributor->visibility == 1) { $dom = new \Podlove\DomDocumentFragment(); $xml = $dom->createElement('atom:contributor'); // add the empty name tag $name = $dom->createElement('atom:name'); $xml->appendChild($name); // fill name tag with escaped content $name_text = $dom->createTextNode($contributor->getName()); $name->appendChild($name_text); if ($contributor->guid) { $xml->appendChild($dom->createElement('atom:uri', $contributor->guid)); } $dom->appendChild($xml); $contributor_xml .= (string) $dom; } return $contributor_xml; }