...But there seems to be far too little information to
Where is your code? ...is the XML read in dynamically?
Where is an example of the XML file format?
What kind of errors are you getting? ...where and when?
There are many answers to this problem but which fits your
issues is hard to tell.