MltoXml
The node that turns YAML or TOML into XML, and when you'd ever want that
- STRING
Let's be honest up front: ComfyUI has a long tail of tiny text-utility nodes, and this is one of the tiniest. MltoXml parses a block of YAML or TOML and hands you back XML. No API, no model, no image anywhere in sight. So why would you reach for it? Because XML still has a life outside 1999 - some APIs expect XML payloads, some LLM pipelines want their structured context as XML, and if your workflow keeps its parameters in a YAML block that a downstream consumer needs in XML, this is the node that does the conversion in-graph instead of you running it through a web converter by hand.
The honest counterpoint: it has essentially zero community footprint. It's niche, and most ComfyUI users will never touch it. It's the kind of node you install the one day you need it, and then it just sits there.
How it works
The mechanism is short and boring in a good way. Feed it text plus a format flag:
yaml→yaml.load(text, Loader=yaml.SafeLoader), thenxmltodict.unparse(...)with pretty-printing on.toml→toml.loads(text), then the same unparse.text→ passthrough. The input comes back unchanged.
That last option is worth noticing: it's an identity mode, so you can use one node as a straight string pass-through if you ever want to switch formats without rewiring. And SafeLoader is a small relief - it means the YAML path won't execute arbitrary Python objects, which is a real footgun with the plain yaml.load.
One author detail: the current version was updated to strip the <?xml ...?> declaration and pretty-print, so you get clean, indented XML instead of an ugly one-liner. Good call.
The inputs that matter
There are exactly two, and you'll set both every time:
- text - multiline STRING. The YAML or TOML you want converted.
- format - enum:
text,yaml, ortoml. Tells the node what it's looking at.
The output is a single STRING holding your XML (or the passthrough text). Wire it into anything that takes a string - a text preview, an LLM prompt, or a Save Text node from another pack.
Installing it
ComfyUI Manager → search "ComfyUI-MltoXml" → Install, then restart. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/NewBieAI-Lab/ComfyUI-MltoXml
then restart ComfyUI.
Issues and gotchas
The big one is that the pack ships no requirements.txt, and it imports three libraries at the top of the file: yaml, toml, and xmltodict. PyYAML is a core ComfyUI dependency, so that's usually already there - but toml and xmltodict typically aren't in a stock environment. When they're missing, the whole package fails to import silently: no error in the UI, the node just never appears in the menu. Fix it with:
pip install toml xmltodict
(On the Windows portable build, that's python_embeded\python.exe -m pip install toml xmltodict.)
Other things that will bite:
- Malformed input throws -
yaml.YAMLErrorortoml.TomlDecodeError- and the node goes red. Nothing crashes, but there's no graceful fallback. - XML is stricter than YAML. Dict keys have to be strings, so a YAML map with numeric or boolean keys (
1: value) fails or serializes weirdly inxmltodict. - Types don't round-trip. Numbers and booleans become text nodes, so don't expect to parse the XML back into the same YAML with types intact.
One more thing, and it's the same advice I'd give for any unknown pack in the post-malware era: this is a brand-new, single-commit project (Dec 2025) by a small org account, so skim the source before you install - it's about 80 lines and does exactly what it claims. If you don't need XML in a ComfyUI workflow, this node isn't for you. If you do, it's the only game in town.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| format | COMBO | text | 3 options: text, yaml, toml |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |