tree-sitter-xml
XML & DTD grammars for tree-sitter
Decision gist · record as of 2026-08-14
Yes, if you're building XML parsing or analysis tooling with tree-sitter. The grammar is permissively licensed, installs easily on modern platforms, and has no runtime dependencies. Dormant maintenance is not a blocker for a grammar package—it's stable and unlikely to need frequent updates. Install only if you already use or plan to use tree-sitter's Python bindings.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later; tree-sitter Python bindings must be installed separately to actually parse documents.
- Medium install friction due to compiled wheels; prebuilt binaries available for common platforms (x86_64, arm64, macOS, Linux, Windows) and Python 3.9+.
- Dormant maintenance status (last release 2024-11-13, 639 days ago) means no active updates, though no recent issues reported.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use, modify, and distribute this package with minimal restrictions, provided you retain the license notice.
last release 2024-11-13 (639 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,185,370 downloads/mo, #3,226 on PyPI
Alternatives
Verify before relying
pip install tree-sitter-xml
import tree_sitter_xml
# Use with tree-sitter Python bindings to parse XML- Whether tree-sitter Python bindings are automatically pulled in or must be manually installed
- Specific performance characteristics for large or deeply nested XML documents
- Completeness of DTD support and any known parsing limitations
What it is and what it does
tree-sitter-xml is a parser grammar for the tree-sitter parsing toolkit, providing syntax analysis for XML and DTD files. It follows the W3C XML 1.0 specification and related standards for schema and stylesheet associations. The package is a compiled grammar that integrates with tree-sitter's incremental parsing engine, allowing you to build syntax trees and perform structural analysis on XML documents.
This is a grammar distribution, not a standalone parser—it requires the tree-sitter Python bindings to actually parse files. It's designed for use in editors (Neovim, Emacs) and development tools that need to understand XML structure. With no runtime dependencies and prebuilt wheels for major platforms, installation is straightforward on supported systems.
Use it for
- Syntax highlighting and code navigation for XML files in editor plugins or language servers
- Incremental parsing of XML documents in development tools to track structural changes
- Building AST-based analysis or transformation tools for XML configuration files
- DTD validation and schema-aware XML processing in custom parsing pipelines
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you're building XML parsing or analysis tooling with tree-sitter.
The grammar is permissively licensed, installs easily on modern platforms, and has no runtime dependencies. Dormant maintenance is not a blocker for a grammar package—it's stable and unlikely to need frequent updates. Install only if you already use or plan to use tree-sitter's Python bindings.
Install
tree-sitter-xml on PyPI
Before you install
Medium install friction due to compiled wheels; prebuilt binaries available for common platforms (x86_64, arm64, macOS, Linux, Windows) and Python 3.9+. Dormant maintenance status (last release 2024-11-13, 639 days ago) means no active updates, though no recent issues reported.
Requires Python 3.9 or later; tree-sitter Python bindings must be installed separately to actually parse documents.
License in practice
MIT license is permissive; you can use, modify, and distribute this package with minimal restrictions, provided you retain the license notice.
Quickstart
pip install tree-sitter-xml
import tree_sitter_xml
# Use with tree-sitter Python bindings to parse XML
Verify before relying
- Whether tree-sitter Python bindings are automatically pulled in or must be manually installed
- Specific performance characteristics for large or deeply nested XML documents
- Completeness of DTD support and any known parsing limitations
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Dormant 639 days since the last release |
| First released | |
| Downloads | 2,185,370 / month, #3,226 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseTopic :: Software Development :: CompilersTopic :: Text Processing :: LinguisticTyping :: Typed |
Evidence: tree_sitter_xml-0.7.0-cp39-abi3-macosx_10_9_x86_64.whl; tree_sitter_xml-0.7.0-cp39-abi3-macosx_11_0_arm64.whl; tree_sitter_xml-0.7.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; tree_sitter_xml-0.7.0-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl; tree_sitter_xml-0.7.0-cp39-abi3-musllinux_1_2_x86_64.whl; tree_sitter_xml-0.7.0-cp39-abi3-win_amd64.whl; tree_sitter_xml-0.7.0-cp39-abi3-win_arm64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “xml parser tree-sitter”
- tree-sitter-xmlProvides a tree-sitter parser grammar for XML and DTD files, enabling…
- tree-sitter-cssProvides a CSS grammar parser for tree-sitter, enabling incremental…
- tree-sitter-hclProvides a tree-sitter parser grammar for HCL and Terraform, enabling…
Give your agent the search over MCP, or paste the wish link into any chat.
More Linguistic packages
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
tiktoken is a fast BPE tokenizer that converts text into token sequences compatible with OpenAI models, supporting multiple encoding schemes including o200k_base and model-specific encodings.
Install it if you work with OpenAI APIs or need to understand token boundaries in GPT-family models.
Detects character encoding and language in byte sequences with high accuracy, supporting 99 encodings and returning confidence scores, language tags, and MIME types.
Install it if you need to detect character encoding or language in byte data; the rewrite makes it substantially faster and more accurate than its predecessors.
Converts Unicode text to ASCII by transliterating non-ASCII characters into their closest ASCII equivalents, with no runtime dependencies.
However, if transliteration quality or ongoing maintenance matters, consider unidecode instead despite its GPL-only license.
Lark is a parsing library that builds abstract syntax trees from context-free grammars, supporting multiple parsing algorithms (Earley, LALR(1), CYK) with automatic line and column tracking.
Python bindings to the tree-sitter parsing library, enabling incremental parsing and syntax tree analysis for source code.
See also tree-sitter-html · tree-sitter-toml · tree-sitter-markdown · tree-sitter-yaml · tree-sitter-json · tree-sitter-java · tree-sitter-kotlin · defusedxml · et-xmlfile · xsdata