I have a problem in XML files.I searched the internet and found lots of examples for my problem but I am not an expert on XML files and couldn't solve my problem. I want to do and XML file and work like RSS FEED. So, I am taking my data from my database and try to create the xml-code. Here what I have in my php file(and it is not validated because of this problem: Undefined root element: channel)\[code\]<?phpinclude "connection.php";//create the table with the fields $rss_table = array(); $query = mysql_query("SELECT * FROM rssfeeds"); while($values_query = mysql_fetch_assoc($query)) { $rss_table [] = array( 'title' => $values_query['title'], 'description' => $values_query['summary'], 'link' => $values_query['link'] ); }$doc = new DOMDocument(); $doc->formatOutput = true;$doc->encoding = "utf-8";$r = $doc->createElement( "channel" ); $doc->appendChild( $r ); //$i=0; foreach( $rss_table as $rss ) { $b = $doc->createElement( "item" ); $title = $doc->createElement( "title" ); $title->appendChild( $doc->createTextNode( $rss['title'] ) ); $b->appendChild( $title ); $description = $doc->createElement( "description" ); $description->appendChild( $doc->createTextNode( $rss['description'] ) ); $b->appendChild( $description ); $link = $doc->createElement( "link" ); $link->appendChild( $doc->createTextNode( $rss['link'] ) ); $b->appendChild( $link ); $r->appendChild( $b ); }echo $doc->saveXML();$doc->save("rssfeeds.xml") ?>\[/code\]I want to have title - link - description Simple one... nothing moreAnd here is what I get in rssfeeds.xml file:\[code\]<?xml version="1.0" encoding="utf-8"?><channel> <item> <title>winter week</title> <description>You can come as you are! </description> <link>http://tdm2000international.org/tdm2000international/news.php</link> </item> <item> <title>Greek night</title> <description>elliniki bradua sto magazi</description> <link>http://tdm2000international.org/tdm2000international/news.php</link> </item> <item> <title>event website</title> <description>first of december, how is it going?</description> <link>http://tdm2000international.org/tdm2000international/news.php</link> </item></channel>\[/code\]Nice format, but it has problem. I do not understand where is the problem.Any help would be appreciated(I also check this website for any solution, but I could not found my solution..So, sorry about this post, if it is already exist)