make raising exception on invalid xml explicit
fix undesired behavior for edge-case xml

This case comes up when you have something like
  <n0:foo xmlns:n0="http://foo.com/bar">
      <bar>baz</bar>
  </n0:foo>
in which case tag for bar is not '{}bar' but simply 'bar'