toXml instead of freemarker template in authenticateUser.