Flatten the document?

Topics: Developer Forum
Nov 11, 2012 at 4:32 AM

I need to flatten the document, is there a way at all to do that with the API?

Like if the doc is this

<div>
   <div>
      text1
   </div>
   text2
</div>

It would just give me two text nodes of

text1
text2

?


Thanks,
Steve