Fix db loader xml parsing crash.

- Add catch for xml parser excception.
- Normalize line endings.
- Reorder imports to PEP 8.