Topic: HELP,looking for an old japanese(?) animation movie "magic school"??

Dear users!

I have a friend who is really really looking for a movie (an animation) - she saw it approx 10years ago in the hungarian tv, and the hungarian title was "school of magic" or something like that. I really want to find that movie for her.
Here's all she remembered:
- it was a whole night movie, so 90mins approx
- it was either japanese or chinese, or something like that, but this is not for sure. but she remembers it as an anime, so maybe it was, but its for sure that the whole movie was very dark, very darkly drawed.
- there is a boy who somehow gets into this school of magic, and in this place there are several students and a master. every day they are changing into birds, and they have different, weird missions, like one of it is to find a hanged man, so they have to go and finally they hang someone, so they can go back home..
- the oldest student has to fight the master, but the master always wins, and before the fight the student has to make his own grave, and dig it. and all the students who fight the master die, and finally the boy is next, he also digs his grave -maybe its winter-, but he could defeat the master, so he and also his little sister survives.

I know its not much, but maybe someone recognize it, it would be highly appreciated!!!! Also any tips on how could I find this movie, or how could i find out the original title..

thanks very much!!!