New interface for externalize an object to xml string.