public function parseRoute(SimpleXMLElement $xml) { $route = new Route(); $this->fillProperties($xml, $route); foreach ($xml->rtept as $rtept) { $waypoint = new Waypoint(); $this->fillProperties($rtept, $waypoint); $route->addRoutePoint($waypoint); } $this->document->addRoute($route); }