def serialize(resource):
if isinstance(resource, xtuml.MetaModel):<EOL><INDENT>return serialize_database(resource)<EOL><DEDENT>elif isinstance(resource, type) and issubclass(resource, xtuml.Class):<EOL><INDENT>return serialize_class(resource)<EOL><DEDENT>elif isinstance(resource, xtuml.Association):<EOL><INDENT>return serialize_association(resource)<EOL><DEDENT>elif isinstance(resource, xtuml.Class):<EOL><INDENT>return serialize_instance(resource)<EOL><DEDENT>
Serialize some xtuml *resource*, e.g. an instance or a complete metamodel.