XML output error - PHP
===

I want to create an xml file(linkler.xml) in a php file(like task.php) and read/write xml on this php file for an android app.

But I am getting error : http://i.stack.imgur.com/loumJ.png

Also in xml file error : http://i.stack.imgur.com/nWSwD.png



How can i correct this ? Thanks

    <?php header('Content-type: text/xml'); 
            if(isset($_POST['url'])) { 
            include('curl.php'); 
            include('youtube.php'); 
            $tube = new youtube(); 
            $links = $tube->get($_POST['url']); 
            if($links) { 
            $dosya_adi = "linkler.xml"; 
            $dosya = fopen ($dosya_adi , 'w') or die ("Dosya yok");
            $xml = "<?xml version=\"1.0\" charset=\"utf-8\"?>\n";
            $xml.='<vidlinks>'; 
            $xml.='<tur>'.$links[0][ext].'</tur>'; 
            $xml.='<link>'.$links[0][url].'</link>'; 
            $xml.='<kalite>'.$links[0][type].'</kalite>'; 
            $xml.='</vidlinks>';
            fputs ( $dosya ,$xml ) ; 
            fclose ($dosya);  
            
            echo file_get_contents("http://tizentr.net/ara/linkler.xml");
            ?>
            <?php } else {
            echo $tube->error;
            } }
            ?>


