I'd use the Python console inside GIMP for that - if you happen to be in Windows, take a look on how to install the Python extension for GIMP 2.6 (on Linux it either comes isntalled or is a matter of installing the gimp-python package, probably the same on Mac OS)
From within GIMP's Python console you have access to a huge GIMP API you can check by looking at the help->Procedure Browser dialog - besides having all the other features of Python, including file and strign manipulation.
One you are =in the Python-fu console, it is matter of doing something like this:
import glob
for fname in glob.glob("*.xcf"):
img = pdb.gimp_file_load(fname, fname)
img.flatten()
new_name = fname[:-4] + ".png"
pdb.gimp_file_save(img, img.layers[0], new_name, new_name)
(this will work on the directory GIMP uses as default - concatenate the desried directory to the filepaths to work on other dirs).
If you need to that more than once, take a look on the example plugins that come with gimp-Python, and paste the code above as the core fo a python plug-in for GIMP for your own use.