/*
 * $Id$
 *
 * [ Description ]
 * 
 */

#include "Behavioural/include/XML.h"
#include <fstream>
using namespace std;

namespace morpheo              {
namespace behavioural          {

  void XML::generate_file (string encoding)
  {
    header (encoding);

    string name     = _name;
    string filename =  name + ".xml";

    cout << "Generate file \""<< filename << "\"" << endl;

    ofstream file;
    file.open(filename.c_str(),ios::out | ios::trunc);

    file << get_body();

    file.close();
  };

  void XML::generate_file (void)
  {
    generate_file("UTF-8");
  };

}; // end namespace behavioural          
}; // end namespace morpheo              
