If you want to generate HTML from XML data then you should have formulated this as such from the very start
This is different from mapping which is understood as if you wanted to access HTML fields from code of Infopath Form Web Part Page (generated and used by enterprise Infopath Forms Services of Sharepoint Server 2010)
As well as it is not mapping XML to HTML formatting but vice versa
labyrinth248:s there a better way to do this so the html output is not messy?
So, create and use your own XSL file
PS
This is unrelated to Infopath (or sharepoint) and there are specialized discussion boards on XSLT
If I involve me in a discussion on an Infopath forum, it is because I want, need and/or have time to discuss Infopath-related issues
and if I I want, need and/or have time to other topics, for example on XSLT,, then I participate in those discussions on respective forums/topics.
Otherwise, I found me (and involve others) in awkward situation having wasted my time in vain and off-topic