I think this is the xblock api for doing this, but you're in the XModule api (since this is `definition_to_xml`). It might not matter, but it could be confusing.