void SGalaxy::writeSector(VSFileSystem::VSFile &f, int tabs, const string &sectorType, SGalaxy * planet_types) const
{
  StringMap::const_iterator dat;
  for (dat = data.begin();dat!=data.end();++dat) {
    if ((*dat).first!="jumps") {
      dotabs(f,tabs);
      f.Fprintf ("<var name=\"%s\" value=\"%s\"/>\n",(*dat).first.c_str(),(*dat).second.c_str());
    }
  }
  dat = data.find(std::string("jumps"));
  if (dat!=data.end()) {
    dotabs(f,tabs);
    f.Fprintf("<var name=\"jumps\" value=\"%s\"/>\n",(*dat).second.c_str());
  }
  if (subheirarchy) {
    for (SubHeirarchy::const_iterator it=  subheirarchy->begin();it!=subheirarchy->end();++it) {
      if (&(*it).second!=planet_types) {
        dotabs(f,tabs);
        f.Fprintf ("<%s name=\"%s\">\n",sectorType.c_str(),(*it).first.c_str());
        (*it).second.writeSector(f,tabs+1,sectorType,planet_types);
        dotabs(f,tabs);
        f.Fprintf ("</%s>\n",sectorType.c_str());
      }
    }
  }

}
void dotabs (VSFileSystem::VSFile &f, unsigned int tabs) 
{
	for (unsigned int i=0;i<tabs;++i) {
		f.Fprintf ("\t");
	}
}