Element nodes
An element node encapsulates an XML element.
An element can have zero or one parent and zero or more children. The children can include element nodes, processing instruction nodes, comment nodes, and text nodes. Document and attribute nodes are never children of element nodes. However, an element node is considered to be the parent of its attributes. The attributes of an element node must have unique QNames.
An element node has the following node properties:
- node-name
- parent, possibly empty
- type-name
- children, possibly empty
- attributes, possibly empty
- string-value
- typed-value
- in-scope-namespaces
Element nodes can be constructed in XQuery expressions by using direct or computed constructors.
The type-name property of an element node indicates the relationship between its typed value and its string value. For example, if an element node has the type-name property xs:decimal and the string value "47.5", the typed value is the decimal value 47.5. If the type-name property of an element node is xdt:untyped, the element's typed value is equal to its string value and has the type xdt:untypedAtomic.