I would like to enter a Chinese (Simplified) Characters in a TeX doc that is rendered by XeTeX and have the Pinyin transcription automatically added below the according characters. So, I only enter the Chinese characters and the Pinyin should be looked up through a library.

I have seen that ChinesePod does something similar, so I imagined that someone else must have thought of that and written something for TeX already. Do you know any tools/packages for that for TeX?

Here is a picture of how it should look like: <http://cl.ly/35Lr>