How to create XML or Object tree

Hi All

I want create XML or object tree with some inputs. Like I want to create BPMN diagram for that I have some inputs can I create XML using bpmn-js.

Hi @chinmayi,

Welcome to the forum! Can you maybe be a bit more explicit, what do you want to achieve?

Could you explain your issue in a structured and detailed manner, so anyone has a fair chance to understand your use case?

If you are stuck with a particular problem, provide the necessary context. Phrase your post so that we can follow your line of thought, step by step.

Please revise your post; we may not be able to help you otherwise. We may also close topics of low quality to prevent spam.

Thanks :heart:

Thank you @Niklas_Kiefer Will provide more details.

Want to create a diagram which has Start Event -> Some Task (create folder) - > End Event.
For task I have input josn which has inputs like where this folder gets created and what name should be given to folder. How can I generate object tree from input json.

Can you elaborate on how this “Object tree” should look like?

Its structure should be same which importXML() method does.

Like this
{
id: ‘StartEvent_1’,
x: 100,
y: 100,
width: 50,
height: 50,
businessObject: {
$attrs: Object
$parent: {
$attrs: Object
$parent: ModdleElement
$type: ‘bpmn:Process’
flowElements: Array[1]
id: ‘Process_1’
isExecutable: false
}
$type: ‘bpmn:StartEvent’
id: ‘StartEvent_1’
}
}

Are you already familiar with this object representation we use internally? I’d recommend to have a look at bpmn-moddle and moddle-xml.