public static function getNextSiblingOfType(\DOMElement $element, $elementType) {
    $nextSibling = $element->nextSibling;
    while ($nextSibling && $nextSibling->nodeType != $elementType) {
      $nextSibling = $nextSibling->nextSibling;
    }
    return $nextSibling;
  }