次のHTMLを変換しようとしています
<div class="bbQuote">
    <div class="quoteAuthor">Joe Block</div>
    <div class="quoteContent">This is the first message<br>
        <div class="bbQuote">
            <div class="quoteAuthor">Jane Doe</div>
            <div class="quoteContent">This is the second message</div>
        </div>
    </div>
</div>
次のbbCodeに
[quote=Joe Block]
    This is the first message
    [quote=Jane Doe]
        This is the second message
    [/quote]
[/quote]
jQueryを使用してこれを行うにはどうすればよいですか?
PS:ネストされたHTMLには0個以上の子を含めることができます