protected function getFormatter(Communicator $communicator, array $settings)
    {
        // Build the formatter:
        $formatter = new RecordXmlFormatter($settings);

        // Load set names if we're going to need them:
        if ($formatter->needsSetNames()) {
            $loader = $this->getSetLoader($communicator, $settings);
            if ($writer = $this->getConsoleWriter($settings)) {
                $loader->setOutputWriter($writer);
            }
            $formatter->setSetNames($loader->getNames());
        }

        return $formatter;
    }