Several improvements

* Add format_error/1 function to the generated code.
* The generated code doesn't depend on xml_gen itself.