public function toXml() { $list = $this->toArray(); $xml = new XmlSerializer(); return $xml->encode($list); }