You should put your load function after the onload function.

myxml.onload// Put first

myxml.load//Put after your on load function and it should work just fine