Include error type and code when reporting libxml errors, closes #1113