Hi guys, ok I'm going through this book called "Learning PHP Data Objects". Just saying so there's a reference. Anyway I'm getting the following error when I upload the code below. The page is saved as books.xm.php. Can anyone help me?


This page contains the following errors:

error on line 2 at column 1: Extra content at the end of the document

Below is a rendering of the page up to the first error.
HTML Code:
 * this page lists all of the books we have as an XML data structure
 * PDO LibraryManagement example application
 * @author Dennis Popel

// don't forget the include
// set the content type to be XML
header('Content-Type: application/xml');
// get the books list
$books = Model::getBooksWithAuthors();

// echo XML declaration and open rot element
echo '<?xml version="1.0"?>', "\n";
echo "<books>\n";

// now iterate over every book and display it
while($b = $books->fetch()){

 <book id="<?=$b->id?>">
} // end while($b = $books->fetch()){} loop

echo '</books>';