This will "do the right thing" in many simple XPaths, but still wouldn't guarantee that the entire thing is in order.