Is it appropriate for a PhD student to write reference for a PhD applicant? I am a PhD student, and was recently approached by a (very bright) student in an exercise class I teach, requesting a reference letter for his PhD application. This makes me wonder: Is it OK for a PhD student to write a reference for a PhD applicant? 

There are obvious reasons why I might be able to say something informative: I saw a lot of his solutions to assigned problems, and I saw him work through an extended period of time (as opposed to say, a lecturer, who only sees his grades, and possibly final exam). However, I am concerned that I am not senior enough for my opinion to be taken seriously. Is it a legitimate concern? Would the student be better of asking someone more senior?
I think this is in part a cultural question. For example, in the US, I think letters from current graduate students are not given nearly as much weight as from more "senior" professionals. However, in German schools, it is quite common for senior doctoral students to write letters of recommendation for undergraduates, particularly in disciplines such as engineering, where the group sizes tend to be quite large, and in many cases the professor in charge of the group may never meet the undergraduate in question.