In Eclipse, in the Package Explorer view, select your projects, then right-click ==> Export, select "General > Ant Buildfiles". In the next dialog, check or uncheck your options, then click "Finish" and a build.xml file is generated for each selected project.
Then all you need is a build.xml that will invoke the Ant build for all the projects, something looking like this:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="build-all" name="all-projects">
<target description="Build all projects" name="build-all">
<ant antfile="build.xml" target="build-project" dir="./MyProject1" inheritAll="false"/>
<ant antfile="build.xml" target="build-project" dir="./MyProject2" inheritAll="false"/>
...
<ant antfile="build.xml" target="build-project" dir="./MyProjectN" inheritAll="false"/>
</target>
</project>