\n"; foreach ($arr as $container) { $result .= "\t\n"; foreach ($container as $tag => $value) { $result .= "\t\t<" . $tag . ">" . htmlspecialchars($value) . "\n"; } $result .= "\t\n"; } $result .= ""; if ($print || $print == 1) { if ($header || $header = 1) { $result = "\n" . $result; header("content-type: text/xml"); } print$result; } else { return $result; } } } ?>