Use xPage to show XML

Hi,

I would like to use xPage to generate XML page (for some robots).

How I can say to xPage that it has to show XML but not HTML. I did not find how I can change doctype…

Subject: AfterRenderResponse

Hello,You can use the AfterRenderResponse event on the XPage.

Capture this event, retrieve the writer and flush your XML through that.

Ex:

//Script at afterRenderResponse on XPages events.

var response = facesContext.getExternalContext().getResponse();

var out=response.getOutputStream();

out.write(“<?xml version=\"1.0\"?>”);

out.write(“”+somevalue+“”);

facesContext.responseComplete();