I'm trying to read an XML file and have got so far but need some advice.

My XML file is
Code:
<?xml version="1.0"?><!DOCTYPE quiz [
    <!ELEMENT quiz (title, items)>
    <!ELEMENT title (#PCDATA)>
    <!ELEMENT items (item)+>    
    <!ELEMENT item (question, answer, answer+)>
    <!ELEMENT question (#PCDATA)>
    <!ELEMENT answer (#PCDATA)>
    <!ATTLIST answer correct (y) #IMPLIED>
]>
<quiz>
    <title>Alberta Sparrow</title>
    <items>
        <item>
            <question>What type of bird is Alberta and her family?</question>
            <answer>a robin</answer>
            <answer>a duck</answer>
            <answer correct="y">a sparrow</answer>
            <answer>a blue jay</answer>
        </item>
      </items>
</quiz>
with several <item>s

My PHP is
PHP Code:
$doc = new DOMDocument();
$doc->load('quiz_f487t.xml');
$items $doc->getElementsByTagName("item");
foreach ( 
$items as $item ) {
  
$questions $item->getElementsByTagName("question");
  
$question $questions->item(0)->nodeValue;
 
$answers $item->getElementsByTagName("answer");
  
$answer1 $answers->item(0)->nodeValue;
  
$answer2 $answers->item(1)->nodeValue;
  
$answer3 $answers->item(2)->nodeValue;
  
$answer4 $answers->item(3)->nodeValue;
  echo 
"<p>$question<br \> 1. $answer1<br \> 2. $answer2<br \> 3. $answer3<br \> 4. $answer4</p>\n";

What I want is (a) to print the <title> and (b) to be able to tell which <answer> has the correct="y" attribute.

Many thanks