"; $xml.= "\n"; foreach($buffer as $val) { $xml .= "\n"; foreach ($val as $key => $value) { if(!is_array($value)) { $value=htmlspecialchars($value,ENT_QUOTES,$charset); $xml .= "<$key>".$value."\n"; } } $xml .= "\n"; } $xml .= ""; return $xml; }