/**
* {@inheritDoc}
*/
public function toXml(\SimpleXMLElement $parent = null)
{
if (null !== $parent) {
$xml = $parent->addChild('Address');
} else {
$xml = new \SimpleXMLElement('<Address />');
}
$xml['name'] = $this->name;
// x and y inverted for HAFAS
if ($this->coordinate->x) {
$xml['y'] = Coordinate::floatToInt($this->coordinate->x);
}
if ($this->coordinate->y) {
$xml['x'] = Coordinate::floatToInt($this->coordinate->y);
}
return $xml;
}