function xmlSPSS(fajl)
%HSB 206 99 30, sivo 747474
	DataOpen(fajl);
	if 1 %~SPSSxml(fajl+".xml")
		kalM=1;
		printf("<?xml version='1.0' encoding='Windows-1250'?>\n");
		printf("<data>\n<v label='ANALYSIS'></v>\n<v label='DATA'>\n<v label='VARIABLES'>\n");
		for i=1:nvar
			if (isnum(Data(1,i)) & strlen(GetVarLabel(i)))
				imev = htmlsafe(GetVarName(i));
				if (~sum(Data(:,i)~=floor(Data(:,i))))
					[v,f] = freq(Data(:,i));
					a=size(v,1);
					if v(a)==NaN
						v(a)=[];
						f(a)=[];
					end
					
					if size(v,1)
						if sum(~strlen(GetNumLabel(i,v)))<30
							[x,y,z]=GetMVar(imev);
							if size(x,1)
								for k=1:size(x,1)
									if y(k)==1 %ovo je obicna multipla
										if find(GetVarName(x(k))==imev)==1 %prva varijabla od multip
											%pravimo grupu za FIRST, TOP3, ALL
											printf("<v label='"+htmlsafe(z(k))+"'>\n");
												[v,f] = freq(Data(:,x(k)));
												a=size(v,1);
												if v(a)==NaN
													v(a)=[];
													f(a)=[];
												end
												%-------FIRST
												printf("<v var='" + imev + "' label='FIRST - "+htmlsafe(GetVarLabel(i))+"'>\n");
												for j=1:size(v,1)
													a=GetNumLabel(i,j);
													if strlen(a)
														printf("\t<v var='" + imev + "' val='"+sprintf("%d",v(j)) + "' label='" + htmlsafe(a) + "'/>\n")
													else
														printf("\t<v var='" + imev + "' val='"+sprintf("%d",v(j)) + "' label='" + htmlsafe(sprintf("%d",v(j)))+ "'/>\n")
													end
												end	
												printf("</v>\n")
												
												vars=GetVarName(x(k));
												if size(vars,1)>3
													imevm3="$KAL"+num2str("%d",kalM);
													DataAddMVar(imevm3,vars(1:3))
													SetVarLabel(imevm3,"TOP3 - "+z(k));
													kalM=kalM+1;
													printf("<v var='" + imevm3 + "' label='TOP3 - "+htmlsafe(z(k))+"'>\n");
													for j=1:size(v,1)
														a=GetNumLabel(i,j);
														if strlen(a)
															printf("\t<v var='" + imevm3 + "' val='"+sprintf("%d",v(j)) + "' label='" + htmlsafe(a) + "'/>\n")
														else
															printf("\t<v var='" + imevm3 + "' val='"+sprintf("%d",v(j)) + "' label='" + htmlsafe(sprintf("%d",v(j)))+ "'/>\n")
														end
													end	
													printf("</v>\n")
												end
												printf("<v var='" + x(k) + "' label='ALL - "+htmlsafe(z(k))+"'>\n");
												for j=1:size(v,1)
													a=GetNumLabel(i,j);
													if strlen(a)
														printf("\t<v var='" + x(k) + "' val='"+sprintf("%d",v(j)) + "' label='" + htmlsafe(a) + "'/>\n")
													else
														printf("\t<v var='" + x(k) + "' val='"+sprintf("%d",v(j)) + "' label='" + htmlsafe(sprintf("%d",v(j)))+ "'/>\n")
													end
												end	
												printf("</v>\n")
											printf("</v>\n")
										end
									end
								end
							else
								printf("<v var='" + imev + "' label='"+htmlsafe(GetVarLabel(i))+"'>\n");
								for j=1:size(v,1)
									a=GetNumLabel(i,j);
									if strlen(a)
										printf("\t<v var='" + imev + "' val='"+sprintf("%d",v(j)) + "' label='" + htmlsafe(a) + "'/>\n")
									else
										printf("\t<v var='" + imev + "' val='"+sprintf("%d",v(j)) + "' label='" + htmlsafe(sprintf("%d",v(j)))+ "'/>\n")
									end
								end	
								printf("</v>\n")
							end
						else
							printf("<v var='" + imev + "' label='"+htmlsafe(GetVarLabel(i))+"' k='k'>\n");
							printf("<v label='Mean' val='mean' k='s'/>\n");
							printf("<v label='Share' val='colshare' k='s'/>\n");
							printf("</v>\n");
						end
					end
				else
					printf("<v var='" + imev + "' label='"+htmlsafe(GetVarLabel(i))+"' k='k'>\n");
					printf("<v label='Mean' val='mean' k='s'/>\n");
					printf("<v label='Share' val='colshare' k='s'/>\n");
					printf("</v>\n");
				end
			end
		end
		printf("</v>\n");
		printf("<v label='MY VARIABLES'>\n</v>")
		printf("<v label='STATISTICS' k='k'>\n\t<v label='%% within Segment' val='colpct' k='s'/>\n\t<v label='%% within Population' val='poppct' k='s'/>\n")
		printf("\t<v label='Count'  val='count' k='s'/>\n\t<v label='Population'  val='pop1000' k='s'/>\n\t<v label='Index'  val='index' k='s'/>\n</v>")
		printf("</v>\n</data>");
	end
end