Not able to get xml output from api and how to create api for xml ourput

Not able to get xml output from api and how to create api for xml ourput