public function mergeNode(ParentNode $node) {
    $child = $node->head;
    while ($child) {
      $next = $child->next;
      $this->appendChild($child);
      $child = $next;
    }
    foreach ($node->getChildProperties() as $name => $value) {
      $this->{$name} = $value;
    }
  }