Added support for xml output. Respond based on HTTP Accept header. Fix res.headersSent typo