Add full support for reading from stdin (JSON or XML)