wrapping non-nested elements

wrapping non-nested elements

Hiya,

I would like to wrap the elements in this structure:
Copy code
  1. <h4>header1</h4>
  2. <p> some text</p>
  3. <p> some more text</p>
  4. <h4>header 2</h4>
  5. <p>text</p>
so I would get two divs, each conatining the h4 and however many p's there are underneath.
- and there are up to 10 of these blocks, so I can't do it manually.

I tried some nextAll and nextUntil but couldnt get it to work. 
And since I am new to jQuery I am not even sure if it can be done...?

Hoping for help
Andreas