Generating XML from an array
<? $channel = array('title' => "A", 'link' => 'http://example.com/', 'description' => 'test'); print "<channel>\n"; foreach ($channel as $element => $content) { print " <$element>"; print htmlentities($content); print "</$element>\n"; } print "</channel>"; ?>