smithery.ai

json-to-xml-converter

Convert JSON data to XML format with customizable root element and attribute handling

First seen Apr 7, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,552 B
  • docs SUMMARY.md 114 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

JSON to XML Converter Skill

Purpose

Convert JSON data structures into well-formed XML documents. Handles nested objects, arrays, and primitive types.

Usage

Command Line

# Basic conversion
python .github/skills/json-to-xml-converter/scripts/json2xml.py input.json output.xml

# Custom root element
python .github/skills/json-to-xml-converter/scripts/json2xml.py input.json output.xml --root "data"

# Pipe data
echo '{"name": "test"}' | python .github/skills/json-to-xml-converter/scripts/json2xml.py - -

Parameters

  • input_file: Path to JSON file or - for stdin
  • output_file: Path to XML output file or - for stdout
  • --root: Root element name (default: "root")

Example

Input JSON:

{"user": {"name": "Alice", "age": 30}, "items": [1, 2, 3]}

Output XML:

<?xml version="1.0" encoding="utf-8"?>
<root>
  <user>
    <name>Alice</name>
    <age>30</age>
  </user>
  <items>
    <item>1</item>
    <item>2</item>
    <item>3</item>
  </items>
</root>

Agent Integration

Use runinterminal to invoke the script:

python .github/skills/json-to-xml-converter/scripts/json2xml.py input.json output.xml --root "mydata"

Important Notes:

  • No external dependencies (Python stdlib only)
  • JSON keys with spaces are converted to underscores
  • Arrays become <item> elements
  • Handles invalid JSON with clear error messages