File Exception and foreach fails solved (xml manipulation to be fixed)