public static function arrayToXml(array $data)
    {
        $xml = '';
        foreach ($data as $key => $value) {
            $tag = (is_numeric($key)) ? 'item' : $key;

            $xml = (!empty($xml)) ? $xml : '';
            if (is_array($value)) {
                $xml .= "<$tag index=\"" . $key . "\">" . self::arrayToXml($value) . "</$tag>";
            } else {
                $xml .= "<$tag>" . $value . "</$tag>";
            }
        }

        return $xml;
    }