More fixes to the xml encoder.