Use XSLT, save yourself the headache 🙂