Load XML and run an XPath query
Paste XML into the XML document field and the expandable document tree loads as soon as the content is valid. Use the browse files control to choose a .xml file, or drop it into the drop area. Parse errors appear in the interface.
- Review the loaded document in the expandable tree.
- Enter an XPath expression in the XPath expression field, or use the quick-insert controls:
//,/,*,@*,[1],[last()],[@id=''],text(), andcount(). - Results update automatically. Results may be elements, attributes, text nodes, comments, processing instructions, or scalar number, string, and boolean values.
Map namespaces and use the document tree
The namespace table is auto-detected from XML declarations and remains editable. Use Add row to add a mapping or Re-detect from document to scan the loaded XML again. In XPath 1.0, default-namespaced elements still need a prefix in the expression. The generated prefix is normally default, but the tool can choose another generated prefix if that name is already used.
Use Expand all and Collapse all to control tree visibility. Click a tree label to insert its path into the XPath expression field. If the document uses namespaces, adapt the inserted element names to the mapped prefixes and the results update automatically.
Build and refine XPath expressions
The browser evaluates XPath 1.0 expressions, including absolute and relative paths, //, wildcards, attributes, predicates, axes, node tests, core functions, and scalar expressions. A relative expression is evaluated from the document context; use an absolute path or // when searching below a named root.
Use paths such as /store/book, filters such as book[@category='fiction'], axes such as parent::, and functions such as count(), contains(), text(), and position(). XPath 2.0 and 3.0-only constructs are not supported.
Read, copy, and export retained matches
Each retained node result shows an exact XPath, node type, and value preview. Hover over a node result to highlight it in the tree. Scalar results are shown separately as number, string, or boolean values. Use Copy paths, Copy values, or a result row's copy action for individual output.
Use Export XML, Export JSON, Export CSV, or Export TXT. Exports contain the currently retained matches, so they follow Limit. The default is 500 and the maximum is 5000; if the results summary reports truncation, raise Limit and wait for the results to update before exporting.
Limits and unsupported tasks
Each element renders at most 500 child nodes in the tree. Additional children are marked as not rendered there but remain queryable by XPath. The result set is also capped by Limit, from 1 to 5000.
The tool selects and exports matches. It does not mutate or reformat the source, validate XML against syntax or schema rules beyond parsing, compare two documents, or convert the whole document to JSON.
Privacy
Parsing, tree rendering, and XPath evaluation run in the browser with its XML and XPath APIs. The local implementation does not send pasted or uploaded XML to a server.
Frequently Asked Questions
What XPath syntax does this tool support?
Standard XPath 1.0: absolute and relative paths, //, wildcards, attribute selection, predicates, axes, core node tests and functions - evaluated by the browser's native XPath engine.
How do namespaces work?
XPath 1.0 has no default namespace, so even default-namespaced elements need a bound prefix. The namespace table auto-detects prefixes from the document and lets you edit them; use those prefixes in your expression.
Does this tool change or validate my XML?
No. It only reads the document to run your query - it never mutates or reformats the source, and it isn't a schema validator, diff tool, or XML-to-JSON converter.
How do I build a path without typing it by hand?
Click a tree node to insert its path into the XPath expression field, then adapt names to mapped namespace prefixes when needed. Generalize it with a wildcard or predicate and the results update automatically.
What happens with a very large result set?
Results are capped at an explicit limit you control (default 500, up to 5000). If a query matches more, the results panel tells you and you can raise the limit.
What export formats are available?
Export XML, Export JSON, Export CSV, and Export TXT are available. They include retained matches within Limit; the default is 500 and the maximum is 5000. Any single location or value can also be copied individually.