fixed exception on parsing xml (accessing past xml buffer)