Error handling in strict parses is very straight forward - just check the
Either return value. Lazy parses are not so simple. Here are two working
examples that illustrate the ways to handle errors. Here they are:

Lazily parse XML to tree. Note that forcing the XMLParseError return value
will force the entire parse. Therefore, to ensure lazy operation, don't
check the error status until you have processed the tree.

An abstraction for any string type you want to use as xml text (that is,
attribute values or element text content). If you want to use a
new string type with hexpat, you must make it an instance of
GenericXMLString.