Unpickling From XML

The parser returns a fairly complex term made of nested records that represent the XML document. It may help to simplify this term before applying further processing:


fun {Simplify E}
   case E
   of element(...) then Tag = E.tag.name in
      Tag({Map E.children Simplify})
   [] text(...) then
      text({VirtualString.toString E.data})
   end
end