API for read-only access XML structure using DOM-like interface. Implemented over XML lexer, so the structure can be obtained even on malformed, unfinished or errneous documents. The caller may obtain a SyntaxElement corresponding to a given textual position in the XML document. The SyntaxElement can be used to both read contents (attributes, tag name, ...) of the document, or navigate to sibling, predecessor, parent or child Elements. SyntaxElement can be converted to DOM Node; DOM Nodes obtained originally as a result of SyntaxElement conversion can be converted back to SyntaxElements so the caller can retrieve their position within the document.

It is advisable to perform searches or navigation through the document under a document read (write) lock. Implementations in this package read-lock the document internally, but generally no lock is preserved across method calls.

The design / structure of the API is intentionally almost the same as with the obsoleted api located in org.netbeans.modules.xml.text.syntax.dom package to make the existing code migration easier.