XQuery uses input functions to identify the data to be queried. There are two input functions:
doc() returns an entire document, identifying the document by a Universal Resource Identifier (URI). To be more precise, it returns the document node.
collection() returns a collection, which is any sequence of nodes that is associated with a URI. This is often used to identify a database to be used in a query.
|Entity Reference||Character Represented|
If our sample data is in a file named books.xml, then the following query returns the entire document:
A dynamic error is raised if the doc() function is not able to locate the specified document ...