How can i create a xml based a database information

Hello guys,
First of all, I’d like to apologize for my Google English. I know this makes my question very difficult, but I will try anyway:
I have a demand that is to get a pseodo-workflow registered in the database and convert it into a bpmn diagama.

By doing a reverse engineering of the generated diagram, I saw that an xml is mounted. However, there is one issue that prevents me from pursuing: the x and y positions.

What would be the best way to generate a diagram based on information from the database?
Is there any API that I could use to generate a diagram?

Once again, I apologize for possible grammatical errors and thank you all.

What information are you getting from your database? You can model diagrams programmatically by using the existing APIs in diagram-js and bpmn-js. What is the problem with the positions?

My need is to create diagrams that represent the flow of the system. So a module will be a diagram and its functionality will be actions/events and so on.

These features are stored in database and retrieved via PHP. My idea was to generate the XML still in PHP and render used the bpmn.io engine.

The positions: nothing has gone wrong. But by generating XML via PHP, I lose the native positioning feature of bpmn.io. Am I right? So I asked if there is an API that I can use to make my work easier.

If I understand you correctly you’re generating some XML that is valid BPMN but is missing the DI information. You would then need to somehow generate this information automatically. There is a small example implementation that creates DI information automatically. You could use this as a starting point for creating a bpmn-js extension that allows you to load XML with missing DI.

This looks really interesting, but I am very new here. Could you give me a pointer to documentation showing how to actually use/integrate an extension like this?