fixed error in _to_xml method of base class