Generate AgentAdaptor from xml rather than hand-code it