Fixed (hopefully) the base64 nonsense, cleaned the xml a bit