How to generate xml file with retool?

As mentioned above, you can add a library globally or at the app level. To add a custom library at the app level, go to Settings -> Libraries -> Add: https://cdn.jsdelivr.net/npm/xml-js@1.6.11/dist/xml-js.min.js.

One note is that you will not need to use any import statements in Javascript queries. Once the library is imported, you can access it directly without the need for importing. Library compatibility varies, but we have an export as xml example is shown here.

Currently, React code is only compatible inside a custom component. You may choose to use your library that you've added globally or at the app level inside a Javascript query, or you may choose to import your library within a custom React component.