XPath Tester

Query XML documents using XPath expressions.

XPath Examples
/ - Root element
/bookstore - Root element named 'bookstore'
/bookstore/book - All book elements under bookstore
//book - All book elements anywhere
/bookstore/book[1] - First book element
/bookstore/book[last()] - Last book element
/bookstore/book[position()<3] - First two books
//title[@lang] - All titles with lang attribute
//title[@lang='en'] - Titles with lang='en'
/bookstore/book[price>35] - Books with price > 35
//book/title | //book/price - All titles and prices
//@lang - All lang attributes
//title/text() - Text content of all titles
count(//book) - Count of all books
sum(//book/price) - Sum of all prices
Sample XML