use cmdliner, also debug flag
instead of dumping XML on stdout, provide a debug flag and dump to out.txt