Perhaps someone will be more patient than me, but can I suggest you learn about sentences, paragraphs, and the comma and when to use them. It makes it far easier to read and comprehend if you include these appropriately.
From a very quick skim it appears your problem is with something external to XBMC, so is probably suited to another forum.
Thanks,
Jonathan