code: public FileDefinition buildFileDefinition( Collection<Instance> rootInstances, File targetFile, boolean addComment, boolean saveRuntimeInformation ) {
  
  		FileDefinition result = new FileDefinition( targetFile );
  		result.setFileType( FileDefinition.INSTANCE );
  		if( addComment ) {
  			String s = "# File created from an in-memory model,\n# without a binding to existing files.";
  			BlockComment initialComment = new BlockComment( result, s );
  			result.getBlocks().add( initialComment );
  			result.getBlocks().add( new BlockBlank( result, "\n" ));
  		}
  
  		for( Instance rootInstance : rootInstances )
  			result.getBlocks().addAll( buildInstanceOf( result, rootInstance, addComment, saveRuntimeInformation ));
  
  		return result;
  	}
docs: Builds a file definition from a collection of instances.
  @param rootInstances the root instances (not null)
  @param targetFile the target file (will not be written)
  @param addComment true to insert generated comments
  @param saveRuntimeInformation true to save runtime information (such as IP...), false otherwise
  @return a non-null file definition