XQuery is an expression oriented query language which follows a tree structure hierarchy of nodes to represent a XML document. It was developed by World Wide Web Consortium (W3C). XQuery was developed to overcome the limitations of SQL for handling XML documents. By using XQuery new XML documents can also be created. Here are the nodes used in XQuery:
1) Text node: It is used for representing contents of an element.
2) Element node: It is used for representing an element.
3) Attribute node: It is used for representing an attribute and attribute value for an element.
4) Document node: It is used for representing document root.
Path expression: It is used for navigating through an item tree and identifying items for processing. It is of two types:
Rooted path expression: Rooted path expression starts from the root of tree and navigates down through the tree to reach a specific node.
Relative path expression: Relative path expression starts from the current node and navigates up or down through the tree to reach a specific node.