На выбор:
<div id="id" />
<script>
document.getElementById('id').firstChild.nodeValue = '<p>foo</p>';
</script>
<div id="id" />
<script>
document.getElementById('id').firstChild.data = '<p>foo</p>';
</script>
<div id="id" />
<script>
document.getElementById('id').firstChild.appendData('<p>foo</p>');
</script>
<div id="id" />
<script>
document.getElementById('id').firstChild.insertData(0, '<p>foo</p>');
</script>
<div id="id" />
<script>
document.getElementById('id').appendChild(document.createTextNode('<p>foo</p>'));
</script>
<div id="id" />
<script>
document.getElementById('id').innerHTML = '<xmp><p>foo</p></xmp>';
</script>