# xnv

11 April 2026 · https://www.jaedonmunton.pro/work/xnv

> A terminal tool for exploring XML with XPath-like queries that filter the document as you type. Written in Rust.

Link: https://github.com/jaedmunt/xnv

xnv is a terminal viewer for XML. You type an XPath-like query and the document tree filters in real time. Press Enter twice when you've found what you need and it prints the query and the result to stdout. It's inspired by [jnv](https://github.com/ynqa/jnv), which does the same for JSON.

Install it with `cargo install xnv`, or `brew install jaedmunt/tap/xnv`. There are prebuilt binaries for Linux, macOS and Windows on the [releases page](https://github.com/jaedmunt/xnv/releases).

```sh
xnv data.xml
cat data.xml | xnv
xnv data.xml --default-filter '//item'
```

Queries cover the common cases.

| Query | Result |
|---|---|
| `//tag` | All elements named `tag` |
| `/root/child` | Elements at an exact path |
| `@attr` | Elements with that attribute |
| `@attr=value` | Elements where the attribute equals `value` |
| `//tag/text()` | Just the text, no tags |

Tab autocompletes paths, Shift and the arrow keys switch between the query and the tree, and Ctrl+H shows every keybinding.
