The result is to provide a declarative, interoperable way of associating behaviors with XML-based documents such as XHTML.
XML Events uses a separation of concerns design pattern, and is technology-neutral with regard to handlers.
It gives authors freedom in organizing their code and allows separation of document content from scripting.
XML Events are used extensively in XForms and in version 1.2 of the SVG specification, as of July 2006[update], which is still a working draft.
The following is an example of how XML events are used in the XForms specification: In this example, when the DOMActivate event occurs on the data element with an id attribute of myButton, the handler doit (for example, a JavaScript element) is executed.