abstract out some xml calls
top level elements, fixes #12
more testing