I would forgo getopt in favor of argparse, which has a very good tutorial here. argparse shows nicer errors with less work. I think getopt is used mainly for compatibility with the C API Both modules, however, support fewer arguments. In your particular case, you will probably want to do something like the following
import argparse
def parse_args():
parser = argparse.ArgumentParser(usage)
help = "The file to operate on"
parser.add_argument("infile", type=argparse.FileType('r'), help=help)
args = parser.parse_args()
return args.infile
Depending on your needs, lxml can be very useful/powerful. I've personally used BeautifulSoup (for some not-so-complicated XML stuff). The recommended module in the Standard Library is ElementTree which has a nice API and can do a lot of XML things.
edit: getopt is not deprecated as I incorrectly stated before