rename SetAgent and ToXML, and update some testcase