private function transformToText($data, $hypertextRoutes = [], $depth = 0)
    {
        // Return the data as string if it's not an array
        if (!is_array($data)) {
            return "{$data}\n{$this->getHypertextString($hypertextRoutes)}";
        }

        // Loop through the data and add to the string
        $str = '';
        foreach ($data as $k => $v) {
            // Add tabs
            for ($i = 0; $i < $depth; $i++) {
                $str .= "\t";
            }

            if (is_array($v)) {
                // Recursively transform underlying data
                $str .= "{$k}: {$this->transformToText($v, [], $depth+1)}\n";
            } else {
                $str .= "{$k}: {$v}\n";
            }
        }

        // Add the hypertext routes
        $str .= $this->getHypertextString($hypertextRoutes);
        return $str;
    }