Do you make a level editor?
I don't know about X files, but you can save files an then read the file by hand or let the computer do it and create objects from the file's options.
Anyway, here is an example of a file writer:
#include "DarkGDK.h"
#include "fstream"
using namespace::std;
int objcounter = 10; //A variabale that counts the amount of objects.
void WriteFile()
{
ofstream loadedfile; //Filestream something...
char * file = "C:\\Yourfile.txt"; //Your filename.
loadedfile.open(file, ios_base::out|ios_base::trunc); //Create a new file and load it to the filestream.
for(int a = 1; a < objcounter; a++)
{
if(dbObjectExist(a))
{
//Write to the file, objectdata seperated with comma.
loadedfile << a << ", " << dbObjectPositionX(a) << ", " <<
dbObjectPositionY(a) << ", " << dbObjectPositionZ(a);
//Write new line if there is more objectdata to write.
if(a < objcounter - 1)
{
loadedfile << "\n";
}
}
}
}
That will make a file with text like this:
1, 32, 42, 24
2, 78, 62, 54
...
The first value is the object number, the second is the x value and then the y value and z value.