public function sort(&$data)
    {
        if (is_array($data)) {
            $data = new DataList($data);
        }
        $dataToSort = $data->toArray();
        try {
            $data->replace($this->performSort(0, $dataToSort));
        } catch (CiteProcException $e) {
            //nothing to do, because $data is passed by referenced
        }
    }