serialize(); } $xml = new \SimpleXMLElement("<{$this->rootElement}>rootElement}>"); $this->arrayToXml($array, $xml); return $xml->asXML(); } /** * @param array $array * @param \SimpleXMLElement $xml */ protected function arrayToXml($array, \SimpleXMLElement &$xml) { foreach ($array as $key => $value) { if (is_array($value)) { if (!is_numeric($key)) { $subnode = $xml->addChild("$key"); $this->arrayToXml($value, $subnode); } else { $subnode = $xml->addChild($this->listElement . ($this->listElementSuffix ? $key : "")); $this->arrayToXml($value, $subnode); } } else { $xml->addChild("$key", htmlspecialchars("$value")); } } } /** * @param mixed $rootElement * @return XmlFormatter */ public function withRootElement($rootElement) { $this->rootElement = $rootElement; return $this; } /** * @param mixed $listElement * @return XmlFormatter */ public function withListElement($listElement) { $this->listElement = $listElement; return $this; } /** * @param mixed $listElementSuffix * @return XmlFormatter */ public function withListElementSuffix() { $this->listElementSuffix = true; return $this; } } __halt_compiler();----SIGNATURE:----hL2p0e6GtzjFYCHLGSCW1vqS/4VGzhYtZPPH10iK19j3rx+Grvp0Xsa/YdFdnXRJRfRtzeTGytiI2z9ELWdnHPwYvWQd41eCbeWmkNQup4lDrEWRqwlnPRFidRahCtd1I7V2OkmKFXaTlXGIrzk5Aw30i26P8H4z3UJOWS7z92wUDnKFMf/mgWJlmeNIkwxxpiemkv34V8R3HyoSKHylmyEYJqan/rKc8QgSlqiI93atxhLI+POv4Y3tdtGCYb2HcDIfSK2wzQCT61ySp0du5M26xkxrjDVsxkv+f1wZWUd5SLWOxoVYVwS6XJJup4ur1p0elfpyO5/BUXenNv/GXllR2+TSlruCj2fVp1NQTymJyCs7G3WGhFDk5aYqfT+ODtq+TSN/qertN9BQ8wl8h6afHEom8IYJojJbMABfNXWeIHiOtLqM2aOyrm2BwoHbuaQL6tJmFq4HbHSb1skRR8F4Xmef2driTB1+81plRkHaK3JqjzoA72BnOtiK3HgvGh1BXiFyeI0jTj0xr6JzWdfZ5vht/ZuoZMSwI0YlRKIbiMvPQu7cFkihtc4sb7hjpYlqOQ4pVEtV6vKdKqAWU63O1TXGY57x3VnygmOKkoz5MB9HVrmaZ3vMdPj1PbtleP6nsqQ4ZZywBaVV0CBmYzMY8JjDDehQFSSba4wsfFQ=----ATTACHMENT:----NjgxNDg5ODY2NzI0ODE5MiA1NjM5NDQyMzA1ODU1MTM5IDI0ODY2NjQ3MDI1MjQxOTI=