<?php
include("example.inc");
if (!$dom = domxml_open_mem($xmlstr)) {
echo "Error while parsing the document\n";
exit;
}
$root = $dom->document_element();
print_r($root);
?>
The above example will output:
domelement Object
(
[type] => 1
[tagname] => chapter
[0] => 6
[1] => 137960648
)