code: public function downloadAction()
      {
          $type = $this->getRequest()->getParam('type', 'xml');
          /** @var Mage_Core_Model_Config_Element $configNode */
          $configNode = Mage::app()->getConfig()->getNode();
  
          switch ($type) {
              case 'txt';
                  $this->downloadAsText($configNode);
                  break;
              case 'xml':
              default:
                  $this->downloadAsXml($configNode);
          }
      }
docs: Download configuration as text or xml action