point = Point::createFromArray($array); return $this; } public function asDOMElement(\DOMDocument $document): \DOMElement { $xml = parent::asDOMElement($document); $xml->setAttribute('lat', $this->point->latitude); $xml->setAttribute('lon', $this->point->longitude); return $xml; } }