XPath Tester

Paste XML, write an XPath expression, and instantly see matched nodes or values. Supports XPath 1.0 expressions.

Why Use the XPath Tester?

XPath expressions let you query and extract specific nodes from XML documents. This tool is perfect for testing and debugging XPath queries before using them in your code — whether you are scraping data, transforming documents with XSLT, or building XML parsers using the DOM API.

Make sure your XML is well-formed first with our XML Validator, then use the XML Formatter to prettify the document for easier XPath writing. New to XML? Start with our XML fundamentals guide.

Example Input

Paste your XML document:

<bookstore>
  <book category="fiction">
    <title>The Great Gatsby</title>
    <author>F. Scott Fitzgerald</author>
    <price>10.99</price>
  </book>
  <book category="tech">
    <title>Learning XML</title>
    <author>Erik T. Ray</author>
    <price>39.95</price>
  </book>
</bookstore>

Then enter an XPath expression like:

//book[@category="fiction"]/title

Example Output

The tester returns the matched nodes:

<title>The Great Gatsby</title>