public function sortKey() {
    if ($this instanceof RootNode) {
      return spl_object_hash($this);
    }
    if (!$this->parent) {
      return '~/' . spl_object_hash($this);
    }
    $path = $this->parent->sortKey() . '/';
    $position = 0;
    $previous = $this->previous;
    while ($previous) {
      $position++;
      $previous = $previous->previous;
    }
    $path .= $position;
    return $path;
  }