# Bpmn-moddle toXml function- first letter of definitions and process tags are uppercase

**URL:** <https://forum.bpmn.io/t/bpmn-moddle-toxml-function-first-letter-of-definitions-and-process-tags-are-uppercase/5788>\
**Category:** Developers\
**Created:** [February 3, 2021, 10:44am UTC](https://forum.bpmn.io/t/bpmn-moddle-toxml-function-first-letter-of-definitions-and-process-tags-are-uppercase/5788 "2021-02-03T10:44:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ellie\_Pankovska](https://forum.bpmn.io/user_avatar/forum.bpmn.io/ellie_pankovska/32/2156_2.png) [@Ellie\_Pankovska](https://forum.bpmn.io/u/Ellie_Pankovska)\
**Post date:** [February 3, 2021, 10:44am UTC](https://forum.bpmn.io/t/bpmn-moddle-toxml-function-first-letter-of-definitions-and-process-tags-are-uppercase/5788/1 "2021-02-03T10:44:45Z")

</div>

I copied the usage of the fromXml and toXml functions from here: [https://github.com/bpmn-io/bpmn-moddle](https://github.com/bpmn-io/bpmn-moddle). In the original xml, definitions is all lowercase, in the xmlStrUpdated the first letter of both definitions and process is uppercase. What is the reason for that and is there a way to configure it to be lowercase?  
Thanks in advance!

---

<div class="post-metadata">

**Author:** ![philippfromme](https://forum.bpmn.io/user_avatar/forum.bpmn.io/philippfromme/32/2803_2.png) [@philippfromme](https://forum.bpmn.io/u/philippfromme)\
**Post date:** [February 3, 2021, 10:49am UTC](https://forum.bpmn.io/t/bpmn-moddle-toxml-function-first-letter-of-definitions-and-process-tags-are-uppercase/5788/2 "2021-02-03T10:49:51Z")

</div>

Can you provide more context? What did you copy where and how are you using it?

---

<div class="post-metadata">

**Author:** ![Ellie\_Pankovska](https://forum.bpmn.io/user_avatar/forum.bpmn.io/ellie_pankovska/32/2156_2.png) [@Ellie\_Pankovska](https://forum.bpmn.io/u/Ellie_Pankovska)\
**Post date:** [February 3, 2021, 10:58am UTC](https://forum.bpmn.io/t/bpmn-moddle-toxml-function-first-letter-of-definitions-and-process-tags-are-uppercase/5788/3 "2021-02-03T10:58:29Z")

</div>

I copied:

import BpmnModdle from ‘bpmn-moddle’;

const moddle = new BpmnModdle();

const xmlStr =  
‘\<?xml version="1.0" encoding="UTF-8"?\>’ +  
'\<bpmn2:definitions xmlns:bpmn2=“[http://www.omg.org/spec/BPMN/20100524/MODEL](http://www.omg.org/spec/BPMN/20100524/MODEL)” ’ +  
'id=“empty-definitions” ’ +  
‘targetNamespace=“[http://bpmn.io/schema/bpmn](http://bpmn.io/schema/bpmn)”\>’ +  
‘\</bpmn2:definitions\>’;

const {  
rootElement: definitions  
} = await moddle.fromXML(xmlStr);

// update id attribute  
definitions.set(‘id’, ‘NEW ID’);

// add a root element  
const bpmnProcess = moddle.create(‘bpmn:Process’, { id: ‘MyProcess\_1’ });  
definitions.get(‘rootElements’).push(bpmnProcess);

// xmlStrUpdated contains new id and the added process  
const {  
xml: xmlStrUpdated  
} = await moddle.toXML(definitions);

xmlStrUpdated looks like this: \<?xml version="1.0" encoding="UTF-8"?\>  
\<bpmn2:Definitions xmlns:bpmn2=“[http://www.omg.org/spec/BPMN/20100524/MODEL](http://www.omg.org/spec/BPMN/20100524/MODEL)” id=“NEW ID” targetNamespace=“[http://bpmn.io/schema/bpmn](http://bpmn.io/schema/bpmn)”\>\<bpmn2:Process id=“MyProcess\_1” /\>\</bpmn2:Definitions\>

---

<div class="post-metadata">

**Author:** ![Ellie\_Pankovska](https://forum.bpmn.io/user_avatar/forum.bpmn.io/ellie_pankovska/32/2156_2.png) [@Ellie\_Pankovska](https://forum.bpmn.io/u/Ellie_Pankovska)\
**Post date:** [February 3, 2021, 11:04am UTC](https://forum.bpmn.io/t/bpmn-moddle-toxml-function-first-letter-of-definitions-and-process-tags-are-uppercase/5788/4 "2021-02-03T11:04:22Z")

</div>

- I am using a customSchema which extends bpmn:Process and bpmn:Definitions, probably this is the reason for the uppercase

---

<div class="post-metadata">

**Author:** ![philippfromme](https://forum.bpmn.io/user_avatar/forum.bpmn.io/philippfromme/32/2803_2.png) [@philippfromme](https://forum.bpmn.io/u/philippfromme)\
**Post date:** [February 3, 2021, 11:55am UTC](https://forum.bpmn.io/t/bpmn-moddle-toxml-function-first-letter-of-definitions-and-process-tags-are-uppercase/5788/5 "2021-02-03T11:55:37Z")

</div>

bpmn-moddle will serialize elements as uppercase by default. If you want them to be lowercase you need to add that information to your extension:

```json
{
  "name": "Foo",
  "uri": "http://foo.com",
  "prefix": "foo",
  "types": [...],
  "xml": {
    "tagAlias": "lowerCase"
  }
}

```

---

<div class="post-metadata">

**Author:** ![Iak](https://forum.bpmn.io/letter_avatar_proxy/v4/letter/i/6f9a4e/32.png) [@Iak](https://forum.bpmn.io/u/Iak)\
**Post date:** [February 3, 2021, 5:12pm UTC](https://forum.bpmn.io/t/bpmn-moddle-toxml-function-first-letter-of-definitions-and-process-tags-are-uppercase/5788/6 "2021-02-03T17:12:51Z")

</div>

Thanks for the answer. Since XML is case sensitive and elements/attributes have to be in the same form as defined in the schema files, is there a reason behind this implementation?

---

<div class="post-metadata">

**Author:** ![philippfromme](https://forum.bpmn.io/user_avatar/forum.bpmn.io/philippfromme/32/2803_2.png) [@philippfromme](https://forum.bpmn.io/u/philippfromme)\
**Post date:** [February 3, 2021, 7:38pm UTC](https://forum.bpmn.io/t/bpmn-moddle-toxml-function-first-letter-of-definitions-and-process-tags-are-uppercase/5788/7 "2021-02-03T19:38:22Z")

</div>

It allows you to define your [moddle](https://github.com/bpmn-io/moddle) types uppercase (e.g. [`Definitions`](https://github.com/bpmn-io/bpmn-moddle/blob/v7.0.4/test/spec/xml/write.js#L33)) and still have them serialized lowercase (e.g. [`definitions`](https://github.com/bpmn-io/bpmn-moddle/blob/v7.0.4/test/spec/xml/write.js#L35)).

---

<div class="post-metadata">

**Author:** ![nikku](https://forum.bpmn.io/user_avatar/forum.bpmn.io/nikku/32/5130_2.png) [@nikku](https://forum.bpmn.io/u/nikku)\
**Post date:** [July 22, 2025, 3:35pm UTC](https://forum.bpmn.io/t/bpmn-moddle-toxml-function-first-letter-of-definitions-and-process-tags-are-uppercase/5788/8 "2025-07-22T15:35:27Z")

</div>

Closed on July 22, 2025, 3:35pm UTC


