Given a big XML I want to have PART of the XML structure in a tree in memory (THIS IS NOT DOM!!) for example given
<MAIN>
<A>
<B>1</B>
<C>2</C>
<D>3</D>
<H>7</H>
<I>9</I>
<E>2</D>
</A>
<A>
<B>4</B>
<C>5</C>
<D>6</D>
<H>3</H>
<I>0</I>
<E>3</D>
</A>
</MAIN>
after the user selects nodes B and H, I want to have in memory
<MAIN>
<A>
<B>1</B>
<C>2</C>
<D>3</D>
<H>7</H>
</A>
<A>
<B>4</B>
<C>5</C>
<D>6</D>
<H>3</H>
</A>
</MAIN>
sometimes the user wants to filter by node contents, like all B nodes greater than 3, etc.
is there a (SAX?) library to do such thing? preferably in Smalltalk but any other language will be fine.