I took xalan-dev out of the recipients list because this question does not have anything to do with the development of the Xalan software. It doesn't relate to any of the Apache XML projects, either, and really should have been posted to the XSL list at mulberrytech.com instead of the general@xml.apache.org list. Nevertheless, it's an interesting challenge to come up with a generic solution to this common problem. > Let's say I'm doing an over an unknown number of xml > elements. I want to format these elements to an HTML table that 4 columns > wide. Inside my , how do I say "every fourth iteration, > close the and open another "? You don't. You need to change your approach to building tables. Rather than thinking in terms of start tags and end tags, you must think in terms of complete elements; assemble an entire table, table row, or table cell at once.
  I'm not sure this is the shortest solution, but it seems to work. - Mike ________________________________________________________________________ Mike Brown / Hyperreal | Hyperreal http://www.hyperreal.org/music/ PO Box 61334 | XML & XSL http://www.skew.org/xml/ Denver CO 80206-8334 USA | http://www.hyperreal.org/~mike/