Copied XMLPrinter to dgen for debugging, added support for ifs, function calls, and returns.

variable.field appears to be broken.