How to add ids to storage format

Hello there,

with my add-on I provide some templates in storage format. For an export feature I need to parse parts of the created document. But all ids I set will be removed. How can I mark elements in my template with id or any other identifier, so that I can parse them later for my export feature?

Thanks in advance