Somewhat completed load xml data function.