Parse XML
Path: .cursor/skills/parse-xml/SKILL.md
Category: Data Parsing
Triggers: XML files, ACORD, SOAP, XML parsing, XPath
What It Does
Python CLI tool using the standard library for parsing XML. Supports inspecting structure, XPath queries, fuzzy element search, pretty-printing, JSON conversion, and diffing two XML files. Handles ACORD XML, SOAP envelopes, and Safeco carrier responses.
Commands
XML_PY="python3"
XML_SCRIPT=".cursor/skills/parse-xml/scripts/xml_parser.py"
| Command | Purpose |
|---|---|
$XML_PY $XML_SCRIPT inspect "file.xml" | XML structure overview (root element, depth, element counts) |
$XML_PY $XML_SCRIPT query "file.xml" ".//PersPolicy" | XPath query for specific elements |
$XML_PY $XML_SCRIPT find "file.xml" "coverage" | Fuzzy tag name search |
$XML_PY $XML_SCRIPT to-json "file.xml" | Convert XML to JSON |
$XML_PY $XML_SCRIPT diff "file1.xml" "file2.xml" | Compare two XML files |
ACORD XML Context
Safeco integration uses ACORD XML with Safeco proprietary extensions prefixed com.safeco_. In our codebase, dots are converted to double underscores (com__safeco_) for JSON compatibility. This tool handles both formats.
Common Use Case
Inspecting Safeco payment XML samples (CC_ByMail.xml, EFT_EFT.xml, etc.) and debugging ACORD request/response payloads during rate and bind flow development.