According to the JAR, the theoretical knowledge exams leading to the issue of a PPL, CPL or ATPL LICENCE must be done in the same JAA state as your flight training. However, ratings can be done in any JAA state, such as the IR, ME or FI, regardless wher you do you theory.
I did my PPL in Spain, and I currently enrolled on the ATPL theory in the UK distance course. Although I will eventaully have to do the CPL flight training in UK, the IR, ME and FI I can do in Spain, as they are ratings.
Hope this helps....