I think HXT, the Haskell XML / HTML processing library, has really flexible and powerful methods for moving and managing DOM trees using Arrows. http://adit.io/posts/2012-04-14-working_with_HTML_in_haskell.html
However, it seems that HXT only has a String view for the contents of the DOM node. http://hackage.haskell.org/packages/archive/hxt/9.1.6/doc/html/Text-XML-HXT-DOM-TypeDefs.html#t:XNode
Can I use any of ByteString or Text for HXT? Text is preferred since I use HXT with Yesod, which typically uses Text.
Neither HXT nor HaXml supports either bytestring or text, but if you are working with Yesod, you should probably use xml-conduit and html-conduit anyway.