Read and write elements' raw XML content

Normally when you want to add an new element to the XML definition in code you have to create the appropriate modeller element, assign its properties and so on. But is there a way to get and set the element’s raw XML content?

For example:

     
   
	
	    //custom elements here
	
   

When loaded in modeler we get an object like this:

{
  "$type": "bpmn:UserTask",
  "renderings": [
    {
      "extensionElements": {
        "values": [
          //is is possible to get and set the raw XML content that goes here
        ]
      }
    },
    ...
  ],
  ...
}

Is this possible? Thanks!

This is not possible. What is your use case, i.e. why would you like to do this?

The XML part needed for the “rendering” property is generated in an external app. And we just wanted to append that to the existing XML.
I now saw that there is an “moddle-xml” example. Could we use that for parsing the XML part we externaly generate and than use the resulting object to update the “rendering” property?