Dynamically add form elements

Dynamically add form elements

Hi. I'm trying to do something that I didn't think was far-fetched, but I can't figure out how to do it.

I have form that asks a simple question: "How many XYZs do you want to create?"

Then, for every XYZ, it should create several new labels/inputs in the form.

That is, every XYZ looks like this:
<div id="xyz">
    <label>Whatever</label>
    <input> blah blah blah </input
</div>

I looked into .each() and .live(), but I can't wrap my mind around how to do this.
Does anyone have any suggestions?

Thanks!