I'm pretty new at using XML but i'm trying ;-) I want to in 2 different foreach loops get data from xml below:
<?xml version="1.0" encoding="ISO-8859-1"?>
    <player id="1">0</player>
    <player id="2">0</player>
    <chat playerid="2">Some chat here...</chat>
I want to get the 2 players out in one foreach loop and get the chats in another and I want also to get the attributes?

I have tried this but with no luck
PHP Code:
foreach($xml->children() as $players){
// Not sure how to get the attribute?
echo "<br />";

$xml->xpath('//chats') as $chat){
$chat"<br />";

None of these examples gives any results? Please help...

Thanks in advance :-)