kuan - fixed xml agentcode