[jQuery] I would like to return xhtml character entities

[jQuery] I would like to return xhtml character entities


I would like to grab a string that contains '<' and '>' and NOT have
jQuery eval and force my browser to render it has html. It's
difficult for me to convey what I want, but basically I am trying to
send it latin or unicode entity references for the angle brackets and
want to write those brackets as literal brackets, not rendered as
html...
I dunno if that makes sense so here is the code I am testing with:
html -
<div class="test">
    <div>
        &#60;div&#62;
            &#60;p&#62;This is a sample paragraph.&#60;/p&#62;
            &#60;p&#62;This is another sample paragraph.&#60;/p&#62;
            &#60;p&#62;This is one last sample paragraph.&#60;/p&#62;
        &#60;/div&#62;
    </div>
</div>
jQ -
$(document).ready(function() {
    $codetext = $("div.test div").text();
    $("div.test div").empty();
    $("div.test div").append($codetext);
});