通过PHP将XML代码解析为jQuery - 获取XML错误

iam trying to update a ajax inbox. I'm having problems with parsing xml to jquery. I'm allways getting the error, that this isnt an xml file. But its (think?) correct and have no code-mistakes in it.

XML Output:

<?xml version='1.0' ?>
<inboxdata>
 <convid>2</convid>
 <sender_id>1</sender_id>
 <reciever_id>2</reciever_id>
 <msg_count>4</msg_count>
 <last_txt_msg>Hello</last_txt_msg>
 <sender_read>1</sender_read>
 <sender_delete>0</sender_delete>
 <time>23.09.2013 - 19:38</time>
 <userpic>img/ava/1.png</userpic>
</inboxdata>
<inboxdata>
 <convid>4</convid>
 <sender_id>1</sender_id>
 <reciever_id>3</reciever_id>
 <msg_count>0</msg_count>
 <last_txt_msg>No msg</last_txt_msg>
 <sender_read>1</sender_read>
 <sender_delete>0</sender_delete>
 <time>23.09.2013 - 20:25</time>
 <userpic>img/ava/1.png</userpic>
</inboxdata>

PHP:

function show_inbox($mysqli)
{
    if(!isset($_SESSION)){
    sec_session_start();
    }
    $userid = $_SESSION['user_id'];
    $get_conversation = $mysqli->query("SELECT * FROM conversation WHERE sender_id =" . $userid);
    $xml_node = "";
    while ($row = mysqli_fetch_array($get_conversation)) {
            $xml_node     .= "<inboxdata>
";
            $xml_node     .= "<convid>".$row['convid']."</convid>
";
            $xml_node     .= "<sender_id>".$row['sender_id']."</sender_id>
";
            $xml_node     .= "<reciever_id>".$row['reciever_id']."</reciever_id>
";
            $xml_node     .= "<msg_count>".$row['msg_count']."</msg_count>
";
            $xml_node     .= "<last_txt_msg>".$row['last_txt_msg']."</last_txt_msg>
";
            $xml_node     .= "<sender_read>".$row['sender_read']."</sender_read>
";
            $xml_node     .= "<sender_delete>".$row['sender_delete']."</sender_delete>
";
            $xml_node     .= "<time>".$row['time']."</time>
";
            $xml_node     .= "<userpic>img/ava/1.png</userpic>
";
            $xml_node     .= "</inboxdata>
";
    }
    $returnXML = "<?xml version='1.0' ?>
".$xml_node;
    echo $returnXML;
}

java:

function show_inbox()
    {
        result = $.ajax({
        type: 'GET',
        async: false,   // WICHTIG! 
        url: 'functions_chat.php',
        data: ({
            a: "show_inbox"
        }),
       success: function(response){
           alert($(response).find('inboxdata').length);
          $(response).find('inboxdata').each(function(){

         var convid   = $(this).find('convid').text();
         $("ul#chatinbox").prepend("<li>"+convid+"</li");

         });
       }
    }).responseText;
    }

If the Alert from alert($(response).find('inboxdata').length); shows up, it allways counts 0. It should count 2?

If I use $.parseXML(response) I'll get the XML Error: Invalid XML... But why its invalid? It seems valid to me!

Wheres the problem in here? Thanks!

Your XML is invalid because it does not contain a root element (I use the name 'root' in the sample below, but you can use any name):

<?xml version='1.0' ?>
<root>
  ... your actual content here
</root>

You can check your XML using the W3 Online Validator: http://validator.w3.org/check