Don't we have the almost exact same code inside Eliom ? Maybe we should fonctorized it inside tyxml.