There are tools which, given a schema, will generate a sample document conforming to that schema. But I doubt this would be a useful approach. In general for a given document there are an infinite number of possible instances and you have no way of knowing which of these instances will be generated.
Instead of using Java and DOM, why not use XSLT or XQuery to create your document? It's much less work.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
|