Added Palette support.
Separated Xml serialization.