いくつかの単純なXHTMLを前提として、人間が読める形式のプレーンテキストバージョンを作成したいと思います。これには、すべてのHTMLタグを削除する必要がありますが、空白を追加または保持する必要があります。
たとえば、次の入力:
<div>
<p>This is some text, some is <b>bold</b>.</p>
<ul>
<li>Point one</li>
<li>Point two</li>
</ul>
</div>
次のようになります:
"This is some text, some is bold. Point one Point two"
(LI間のコンマが理想的です... :)