A state is needed for global processing options,
like encoding options, document base URI, trace levels
and error message handling

The state is separated into a user defined state
and a system state. The system state contains variables
for error message handling, for tracing, for the document base
for accessing XML documents with relative references, e.g. DTDs,
and a global key value store. This assoc list has strings as keys
and lists of XmlTrees as values. It is used to store arbitrary
XML and text values, e.g. user defined global options.

The user defined part of the store is in the default case empty, defined as ().
It can be extended with an arbitray data type

add the error level and the module where the error occured
to the attributes of a document root node and remove the children when level is greater or equal to c_err.
called by setDocumentStatusFromSystemState when the system state indicates an error

check whether the error level attribute in the system state
is set to error, in this case the children of the document root are
removed and the module name where the error occured and the error level are added as attributes with setDocumentStatus
else nothing is changed