Modifie code with some fixes:
1. Load and Save xml rules file
2. Serialize to XML and GZip over it
3. Store compressed data in database