public function getElementsByTitle($title, $tags = '*')
{
// what are we doing?
$tag = $this->convertTagsToString($tags);
$log = usingLog()->startAction("get '{$tag}' element with title '{$title}'");
// prepare the list of tags
if (is_string($tags)) {
$tags = array($tags);
}
// build up the xpath to use
$xpathList = array();
foreach ($tags as $tag) {
$xpathList[] = 'descendant::' . $tag . '[@title = "' . $title . '"]';
}
// search using the xpath
$elements = $this->getElementsByXpath($xpathList);
// log the result
$log->endAction(count($elements) . " element(s) found");
// return the elements
return $elements;
}