Well, I suspect the solution will be XPATH...
If you're trying to get the title of a book by the id, you'd use the query:
$query = '//DocSum/Id[contains(., "21232919")]';
If you're trying to search for the title of a book:
$query = '//DocSum/Item[@Name="Title" AND contains(., "Metformin")]';
Then just run it:
$xml = simplexml_load_file($url);
$results = $xml->xpath($query);
foreach ($results as $titleElement) {
$book = simplexml_import_dom(dom_import_simplexml($titleElement)->parentNode);
// Handle the book here
}
I'm converting back and forth between simplexml and domdocument since that appears to be the only documented way of traversing up the tree...