Minor bugfixes and enhancements.
Enhancement:
- Issue 9: Add top-level emit_xml() function.
Fixes:
- Issue 7: Parser not correctly detecting corrupt XML input documents.
- Documentation producing wrong cross-references (fixed with 9).
- Redo the logic in the emit_handler() method to split detection of when
it is permissible to use the full_document option from the detection of
when we should default to using it.