See description.

Refactoring.
Added in-memory provider.
Added XML provider.