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

My XML file is
<?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>
    <title>Alberta Sparrow</title>
            <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>
with several <item>s

My PHP is
PHP Code:
$doc = new DOMDocument();
$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;
"<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