public function innerXML()
{
$length = $this->size();
if ($length == 0) {
return;
}
// Only return the first item -- that's what JQ does.
$first = $this->getFirstMatch();
// Catch cases where first item is not a legit DOM object.
if (!$first instanceof \DOMNode) {
return;
} elseif (!$first->hasChildNodes()) {
return '';
}
$buffer = '';
foreach ($first->childNodes as $child) {
$buffer .= $this->document->saveXML($child);
}
return $buffer;
}