private function formatArray(array $data)
{
$xml = '';
if (isset($data[0])) {
$xml .= '<list>';
foreach ($data as $value) {
$xml .= '<value>';
if (is_array($value)) {
$xml .= $this->formatArray($value);
} else {
$xml .= $this->formatValue($value);
}
$xml .= '</value>';
}
$xml .= '</list>';
} else {
foreach ($data as $key => $value) {
$xml .= '<' . $key . '>';
if (is_array($value)) {
$xml .= $this->formatArray($value);
} else {
$xml .= $this->formatValue($value);
}
$xml .= '</' . $key . '>';
}
}
return $xml;
}