Jon Snader (jcs) wrote a series of nice tutorial about how to transform text in the form of lisp expression into XML form, with a focus on making each head of lisp expression a executable function itself (as opposed to just parsing it and spit out XML form). In the last article, he proposed a little challenge for readers to solve. See:
- An Emacs Programming Challenge (2011-12-23) By Jon Snader. @ Source irreal.org
If you got stuck, check out his previous articles (linked in his article), which shows you how.