Extracting Values from a Subtree
I am parsing an XML file with HXT and I am trying to break up some of the node extraction into modular pieces (I have been using this as my guide ). Unfortunately, I cannot figure out how to apply some of the selectors once I do the first level parsing. import Text.XML.HXT.Core let node tag = multi (hasName tag) xml <- readFile "test.xml" let doc = readString [withValidate yes, withParseHTML no, withWarnings no] xml books <- runX $ doc >>> node "book" I see that books has a type [XmlTree] :t books books :: [XmlTree] Now I would like to get the first element of books and then extract some