public function delete(Node $node, $isRecursive = false)
    {
        if (! $node->isHydrated()) {
            $node = $this->getNode($node->getDn());
        }
        $children = $this->getChildrenNodes($node);
        if (count($children) > 0) {
            if (! $isRecursive) {
                throw new DeleteException(
                    sprintf('%s cannot be deleted - it has some children left', $node->getDn())
                );
            }
            foreach ($children as $child) {
                $this->delete($child, true);
            }
        }
        $this->connection->deleteEntry($node->getDn());

    }