如何在php中回显xml?

I have this function and I need to echo an XML but it doesnt work. what is the problem?

static function login_xml($ERROR_ID,$SESSION_ID)
{
  echo "<BR>IN LOGINXML<BR>"; 


  echo '<xml version="1.0">'.
  '<response>log_in</response><parameters><error>'.$ERROR_ID.'</error><session>'
  .$SESSION_ID.'</session></parameters></xml>';
 }

I tried with header('Content-type: text/xml'); before echo, that doesnt work either. What can I do?

Simply remove the line

echo "<BR>IN LOGINXML<BR>"; 

XML should have only one root element, that is <xml> in your case