If it follows a template (standard HTML with spots to accept variables) you might have a build(data) function that takes in your dataset and builds an html string. It would be a lot more maintainable in the long run, also reusable.
Resig has his own templating shebang here:
http://ejohn.org/blog/javascript-micro-templating/
So your function (unrelated to the above link) might look like this:
var myObject = {
name : "Alex",
occupation : "Developer",
faveFormat : "JSON"
}
function buildHTML(obj) {
var name = obj.name;
var occupation = obj.occupation;
var faveFormat = obj.faveFormat;
var resultHTML = [];
resultHTML.push('<li><div>');
resultHTML.push("My name is" + name);
//etc etc
resultHTML.push('</div></li>');
var doneHTML = resultHTML.join(" ");
return doneHTML;
}
Try it out!