Handling ref content in both xml and json.

Also removed a few more setDoOutput(true) when no output being performed.