In last few months I have been generating different kind of files from some specifications. Java Source Files, XML Files, HTML doc files etc. In generating each type of file, I found it useful to define Object Model for that type of file. e.g. Java Source File object model, HTML Object model etc. Then creating this Object from the specifications. And encapsulating all the actual syntax in these objects. is this common pattern while generating documets from specidications?