Yes, anorexia and bulimia are classed as mental illness or behavioural disorders, in some cases it can be assumed to be part of an obsessive complusive disorder, depending on the symptoms and behaviour.
As someone said before, anorexia is often more related towards the ability to control the body or take some kind of control in their life where it may not be possible in other areas, compared with a true wish to lose weight.
It really depends on what school of psychology you're from depending on why people develop eating disorders (Bulimia, Anorexia and EDNOS) whether it is related to their biological genetics. They are predispositioned to become anorexic, however this school of thought suggests that you do need some kind of trigger to actually develop the illness.
I don't believe all the bull about the media and a relationship to eating disorders and that of 'pro-ana' websites, not as a trigger anyway. I can see that it does not help the people already falling into the trap of eating disorders.
From experience (I suffered from anorexia as a teenager) I believe that it is a real mental illness, and once it takes over. It is very hard to break the cycle, you become very paranoid and think that everyone wants you to put on weight, which only exsabates the situation. Almost like split personality disorder; there is two sides of you.
By the way, joeluke doesn't believe in mental illness. Make what you will of that.