public function visit(Visitor $visitor, Generator $generator, $data)
{
$generator->startObjectElement('LocationList');
$visitor->setHeader('Content-Type', $generator->getMediaType('LocationList'));
$generator->startAttribute('href', $data->path);
$generator->endAttribute('href');
$generator->startList('Location');
foreach ($data->locations as $restLocation) {
$generator->startObjectElement('Location');
$generator->startAttribute('href', $this->router->generate('ezpublish_rest_loadLocation', array('locationPath' => trim($restLocation->location->pathString, '/'))));
$generator->endAttribute('href');
$generator->endObjectElement('Location');
}
$generator->endList('Location');
$generator->endObjectElement('LocationList');
}