Split xml serializer into base class.