A path expression is used in XQuery to select XML elements.


Syntax

books.xml

<bookstore>
	<book>
	<name>All about XML</name>
		<price>$20</price>
	</book>
	
	<book>
		<name>Learning XQuery</name>
		<price>$15</price>
	</book>
</bookstore>
Link to original

doc("books.xml")/bookstore/book/name

Read the name of all books with a path expression.

doc("books.xml")//name

Read all the name elements.