changes to xml loader and added some utility functions