My point was just that, if it is already in flowable there is no reason to convert manually. If you need to convert arbitrary input to an image, there are several places in the code where we generate process diagrams. For instance then a new process is deployed, the engine uses the ProcessDefinitionDiagramHelper which you could probably also use. You could also look at the modeler’s code and how its ModelImageService calls out to various DiagramGenerator’s to create thumbnails. In both cases the process gets parsed first before being sent to the Diagram Generators.
Unfortunately I don’t have any simple code examples for you to convert arbitrary XML to a diagram, but perhaps the references in the source will give you a push in the right direction.