Providing info to other web sites


I have a directory, and now I need to show ads from some categories in some external web sites (afiliates), few are asp, php, clf, etc etc.

In the admin panel the registered customers may be able to request a code to install on your website that will display certain ads from our Bd and display them on your web site.

What you think is the best solution?

I thought of a simple iframe, but it will make me load the number of queries to the db.

I thought of a xml, but I think the problem will then provide a single script that need to be installed on your website (which will need an xml reader.)

Any ideas?