I need to deep select a XML node from a document and transform it then move it to another position.
This example is taken from Haskell cafe and slightly changed:
Select the //d/e/f
and then change the content at f
and move the new f
node under a
.
<a>
...
<d>
<e>
<f>some data to change
</f>
</e>
</d>
...
</a>
I need to do this kind of operation for several times, so it's better if the update operation is composeable.
I am looking at xml-conduit package, but seems it lacks of DOM manipulation functions, what's the best way to do this kind of task?