1. IMPROVED: Distinguish between read and write IO errors.
2. ADDED: Encoding error.
3. ADDED: XML name error.