<?php
header ("content-type: text/xml");
echo '<users>';
	if(isset($users))
	{
		foreach($users as $key=>$value)
		{
			echo '<user>';
				echo '<account_id>'.$value->account_id.'</account_id>';
				if($user_type == 'afiliant')
					echo '<name>'.((empty($value->nazwa) ? $value->imie.' '.$value->nazwisko : $value->nazwa)).'</name>';
				else
					echo '<name>'.$value->name.'</name>';	
			echo '</user>';		
		}
	}
echo '</users>';
?>