Gurus, I have a situation where I have an iterator with bunch of java objects. I need to create XML out of that and make sure that output complies with schema. Which is no big deal. But what my question for you guys is which is the best way to go. Use XSLT to do so? or use java API to do so? No place to use JDOM at this point as other part of this application uses XSLT to output incoming XML to a fixed length record format.
And last but not least,for cost saving perposes, I am looking for something like given an iterator of objects and schema it generates XML for me.
I'm not aware of a tool that would generate XML from a Java object according to an arbitrary schema, but you should look at XStream, Castor and JAXB. They all provide some type of Java-to-XML serialization.