# Parsing modes

**LagartoDom** can parse XML, XHTML and HTML content. There are already predefined methods that quickly enable these modes:

* `enableHtmlMode()`
* `enableXhtmlMode()`
* `enableXmlMode()`

### HTML plus mode

There is one more mode available:

* `enableHtmlPlusMode()`

The default HTML mode does not change the order of the nodes. However, HTML5 specification has some rules where nodes are moved around the DOM. For example, all tags written beyond table tags in a table are moved before table definition. Moreover, there are some special rules on which orphan tags may be closed and the scope in which they can be closed.

HTML Plus mode is one that enables these additional parsing rules. These rules require some additional processing and may slow down the processing.

### Debug mode

Regardless of the parsing mode, **LagartoDom** may work in debug mode:

* `enableDebugMode()`

In debugging mode all the errors are collected and their position is calculated. Of course, this slows down the processing.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lagarto.jodd.org/lagarto-dom/parsing-modes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
