factor out some variables, TODO: allow arguments to specify other XML files from the command line