XML Output, custom data above root

Hello

How can i write or add custom code between

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>

I want the output of the XML to be something like

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <mystore>
    <created_at>2024-01-17 12:06</created_at>
  </mystore>
<root>

Is this possible?

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Any ideas? :smiling_face_with_tear:

Hi @Mulen, I don’t know your full data structure, but I think you could simply inject this additional content like so:

@MutedJam Sorry i didn’t give more info.

I meant by using XML Node.

Here is an example

I want to add some additonal data before

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <mystore>
    <created_at>2024-01-17 12:06</created_at>
  </mystore>
<root>

This is the result i want.

I don’t think the XML node can do this, but the approach shared in my last post will still work:

2 Likes

Thanks it is working!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.