#ifdef POSITION
/*
 * $Id$
 *
 * [ Description ]
 * 
 */

#include "Behavioural/include/Component.h"

namespace morpheo              {
namespace behavioural          {

#undef  FUNCTION
#define FUNCTION "Component::toXML"

  XML Component::toXML (void)
  {
    log_printf(FUNC,Behavioural,FUNCTION,"Begin");

    XML xml (_entity->get_name());
    
    xml.balise_open         ("description");
    xml.  insert_XML        (_entity->toXML());
    xml.  balise_open       ("architecture");

    if (_list_component->empty()== false)
      {
	list<Tcomponent_t *>::iterator i = _list_component->begin();

	while (i != _list_component->end())
	  {
	    xml.insert_XML ((*i)->_entity->toXML_mapping());
	    ++i;
	  }
      }
	
    xml.  balise_close      ();
    xml.balise_close        ();
  
    log_printf(FUNC,Behavioural,FUNCTION,"End");
  
    return xml;
  };

}; // end namespace behavioural          
}; // end namespace morpheo              
#endif
