JSON to XML - root with parameters

Describe the problem/error/question

I need to export data to Google Merchant Center. For that, I use XML to JSON, and it works pretty well, except for one thing: parameters are needed for root

Currently, the export gives that:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rss>
  <channel>
    <item>
...

and I need that, otherwise, Google throw an error

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0">
  <channel>
    <item>
...

To make it work, the worauround is to replace the text ‘’ by what is needed. But it is not clean

Is there a way to set correctly?

Please share your workflow

Information on your n8n setup

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

Nobody for that?
Thanks for your help

hello @ppcm

well, I didn’t found the better way, so replace is the option :slight_smile:

Thanks @barn4k,

Nothing better, but it is not the pretty one :slight_smile:
And it is much more consuming than an option in the node…

So it will stay like that until a better way comes to us

I always do without root and then just put it between the correct root tags in whatever field I need to have it. So for example in the body:

{{$json.xmldata}}

Not pretty but it works and is a bit nice than replace I think.