How to delete the contents of a folder without deleting the folder via apache ant

I use Hudson for my build server and when it polled my SCM to check for changes it always invoked a build, regardless of any changes or not! Console ouput has this line
svn: Failed to add directory 'ejb/generated': an unversioned directory of the same name already exists
This was because the build script, as part of its clean target, did

<delete dir="${ejb.generated}" />

which also deleted the folder. not just its contents. Changing it to this did exactly what i needed.

<delete includeemptydirs="true" failonerror="false">
<fileset dir="${ejb.generated}" includes="**/*" />
</delete>

the failonerror="false" means don't fail if the directory doesn't exsist.