protected function xml2array($xmlObject, $out = []) { foreach ((array) $xmlObject as $index => $node) { $out[$index] = is_object($node) ? $this->xml2array($node) : $node; } return $out; }