fix example
add gitignore

from https://github.com/github/gitignore/raw/master/Python.gitignore
use newer requests techniqes

create a requests.session object to hold the custom headers.
this will also keep track of cookies automatically.
check for valid xml in a single place.

I think this exists to work around the issue that netdot is returning
200 status codes even for errors.