diff --git a/HaXml.cabal b/HaXml.cabal
--- a/HaXml.cabal
+++ b/HaXml.cabal
@@ -1,5 +1,5 @@
 name:		HaXml
-version:	1.19.3
+version:	1.19.4
 license:	LGPL
 license-file:	COPYRIGHT
 author:		Malcolm Wallace <Malcolm.Wallace@cs.york.ac.uk>
@@ -41,6 +41,7 @@
         Text.XML.HaXml.ShowXmlLazy,
         Text.XML.HaXml.Types,
         Text.XML.HaXml.TypeMapping,
+        Text.XML.HaXml.Util,
         Text.XML.HaXml.Validate,
         Text.XML.HaXml.Verbatim,
         Text.XML.HaXml.Wrappers,
@@ -59,7 +60,7 @@
   else
     build-depends: base < 2 || >= 3, bytestring
   extensions: CPP, ExistentialQuantification
-  cpp-options: -DVERSION=1.19.3
+  cpp-options: -DVERSION=1.19.4
   nhc98-options: -K10M
 
 Executable Canonicalise
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 SOFTWARE = HaXml
-VERSION  = 1.19.3
+VERSION  = 1.19.4
 
 #CPP      = cpp -traditional
 CPP     = cpphs --text --noline	# useful e.g. on MacOS X
@@ -20,6 +20,7 @@
 	src/Text/XML/HaXml/TypeMapping.hs src/Text/XML/HaXml/XmlContent.hs \
 	src/Text/XML/HaXml/SAX.hs \
 	src/Text/XML/HaXml/ShowXmlLazy.hs \
+	src/Text/XML/HaXml/Util.hs \
 	src/Text/XML/HaXml/Html/Generate.hs src/Text/XML/HaXml/Html/Parse.hs \
 	src/Text/XML/HaXml/Html/Pretty.hs \
 	src/Text/XML/HaXml/Html/ParseLazy.hs \
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -2,7 +2,7 @@
 #       configure -- prepare to compile/install the HaXml package
 #       author:   Malcolm.Wallace@cs.york.ac.uk, August 2002
 
-VERSION="1.19.3"
+VERSION="1.19.4"
 
 if [ -f obj/prefix ]
 then INSTALLDIR=`cat obj/prefix`
diff --git a/docs/HaXml/Text-XML-HaXml-Util.html b/docs/HaXml/Text-XML-HaXml-Util.html
new file mode 100644
--- /dev/null
+++ b/docs/HaXml/Text-XML-HaXml-Util.html
@@ -0,0 +1,261 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!--Rendered using the Haskell Html Library v0.2-->
+<HTML
+><HEAD
+><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"
+><TITLE
+>Text.XML.HaXml.Util</TITLE
+><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css"
+><SCRIPT SRC="haddock.js" TYPE="text/javascript"
+></SCRIPT
+></HEAD
+><BODY
+><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
+><TR
+><TD CLASS="topbar"
+><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
+><TR
+><TD
+><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" "
+></TD
+><TD CLASS="title"
+>HaXml</TD
+><TD CLASS="topbut"
+><A HREF="src/Text/XML/HaXml/Util.html"
+>Source code</A
+></TD
+><TD CLASS="topbut"
+><A HREF="index.html"
+>Contents</A
+></TD
+><TD CLASS="topbut"
+><A HREF="doc-index.html"
+>Index</A
+></TD
+></TR
+></TABLE
+></TD
+></TR
+><TR
+><TD CLASS="modulebar"
+><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
+><TR
+><TD
+><FONT SIZE="6"
+>Text.XML.HaXml.Util</FONT
+></TD
+></TR
+></TABLE
+></TD
+></TR
+><TR
+><TD CLASS="s15"
+></TD
+></TR
+><TR
+><TD
+><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
+><TR
+><TD CLASS="section4"
+><B
+>Contents</B
+></TD
+></TR
+><TR
+><TD
+><DL
+><DT
+><A HREF="#1"
+>utility functions to access XML content
+</A
+></DT
+></DL
+></TD
+></TR
+></TABLE
+></TD
+></TR
+><TR
+><TD CLASS="s15"
+></TD
+></TR
+><TR
+><TD CLASS="section1"
+>Description</TD
+></TR
+><TR
+><TD CLASS="doc"
+><UL
+><LI
+> Only a shmall module containing some helper functions to extract xml content
+ - I would have added this to Types but I've put it into an additional module
+ - to avoid circular references (Verbatim <A HREF="-"
+>-</A
+> Types)
+</LI
+></UL
+></TD
+></TR
+><TR
+><TD CLASS="s15"
+></TD
+></TR
+><TR
+><TD CLASS="section1"
+>Synopsis</TD
+></TR
+><TR
+><TD CLASS="s15"
+></TD
+></TR
+><TR
+><TD CLASS="body"
+><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
+><TR
+><TD CLASS="decl"
+><A HREF="#v%3AdocContent"
+>docContent</A
+> :: i -&gt; <A HREF="Text-XML-HaXml-Types.html#t%3ADocument"
+>Document</A
+> i -&gt; <A HREF="Text-XML-HaXml-Types.html#t%3AContent"
+>Content</A
+> i</TD
+></TR
+><TR
+><TD CLASS="s8"
+></TD
+></TR
+><TR
+><TD CLASS="decl"
+><A HREF="#v%3AcontentElem"
+>contentElem</A
+> :: <A HREF="Text-XML-HaXml-Types.html#t%3AContent"
+>Content</A
+> i -&gt; <A HREF="Text-XML-HaXml-Types.html#t%3AElement"
+>Element</A
+> i</TD
+></TR
+><TR
+><TD CLASS="s8"
+></TD
+></TR
+><TR
+><TD CLASS="decl"
+><A HREF="#v%3Aattrs"
+>attrs</A
+> :: <A HREF="Text-XML-HaXml-Types.html#t%3AElement"
+>Element</A
+> i -&gt; [<A HREF="Text-XML-HaXml-Types.html#t%3AAttribute"
+>Attribute</A
+>]</TD
+></TR
+></TABLE
+></TD
+></TR
+><TR
+><TD CLASS="s15"
+></TD
+></TR
+><TR
+><TD CLASS="s15"
+></TD
+></TR
+><TR
+><TD CLASS="section2"
+><A NAME="1"
+>utility functions to access XML content
+</A
+></TD
+></TR
+><TR
+><TD CLASS="s15"
+></TD
+></TR
+><TR
+><TD CLASS="topdecl"
+><TABLE CLASS="declbar"
+><TR
+><TD CLASS="declname"
+><A NAME="v%3AdocContent"
+></A
+><B
+>docContent</B
+> :: i -&gt; <A HREF="Text-XML-HaXml-Types.html#t%3ADocument"
+>Document</A
+> i -&gt; <A HREF="Text-XML-HaXml-Types.html#t%3AContent"
+>Content</A
+> i</TD
+><TD CLASS="declbut"
+><A HREF="src/Text/XML/HaXml/Util.html#docContent"
+>Source</A
+></TD
+></TR
+></TABLE
+></TD
+></TR
+><TR
+><TD CLASS="s15"
+></TD
+></TR
+><TR
+><TD CLASS="topdecl"
+><TABLE CLASS="declbar"
+><TR
+><TD CLASS="declname"
+><A NAME="v%3AcontentElem"
+></A
+><B
+>contentElem</B
+> :: <A HREF="Text-XML-HaXml-Types.html#t%3AContent"
+>Content</A
+> i -&gt; <A HREF="Text-XML-HaXml-Types.html#t%3AElement"
+>Element</A
+> i</TD
+><TD CLASS="declbut"
+><A HREF="src/Text/XML/HaXml/Util.html#contentElem"
+>Source</A
+></TD
+></TR
+></TABLE
+></TD
+></TR
+><TR
+><TD CLASS="s15"
+></TD
+></TR
+><TR
+><TD CLASS="topdecl"
+><TABLE CLASS="declbar"
+><TR
+><TD CLASS="declname"
+><A NAME="v%3Aattrs"
+></A
+><B
+>attrs</B
+> :: <A HREF="Text-XML-HaXml-Types.html#t%3AElement"
+>Element</A
+> i -&gt; [<A HREF="Text-XML-HaXml-Types.html#t%3AAttribute"
+>Attribute</A
+>]</TD
+><TD CLASS="declbut"
+><A HREF="src/Text/XML/HaXml/Util.html#attrs"
+>Source</A
+></TD
+></TR
+></TABLE
+></TD
+></TR
+><TR
+><TD CLASS="s15"
+></TD
+></TR
+><TR
+><TD CLASS="botbar"
+>Produced by <A HREF="http://www.haskell.org/haddock/"
+>Haddock</A
+> version 0.8</TD
+></TR
+></TABLE
+></BODY
+></HTML
+>
diff --git a/docs/HaXml/doc-index-A.html b/docs/HaXml/doc-index-A.html
--- a/docs/HaXml/doc-index-A.html
+++ b/docs/HaXml/doc-index-A.html
@@ -393,6 +393,14 @@
 ></TR
 ><TR
 ><TD CLASS="indexentry"
+>attrs</TD
+><TD CLASS="indexlinks"
+><A HREF="Text-XML-HaXml-Util.html#v%3Aattrs"
+>Text.XML.HaXml.Util</A
+></TD
+></TR
+><TR
+><TD CLASS="indexentry"
 >attrval</TD
 ><TD CLASS="indexlinks"
 ><A HREF="Text-XML-HaXml-Combinators.html#v%3Aattrval"
diff --git a/docs/HaXml/doc-index-C.html b/docs/HaXml/doc-index-C.html
--- a/docs/HaXml/doc-index-C.html
+++ b/docs/HaXml/doc-index-C.html
@@ -524,6 +524,14 @@
 ></TD
 ></TR
 ><TR
+><TD CLASS="indexentry"
+>contentElem</TD
+><TD CLASS="indexlinks"
+><A HREF="Text-XML-HaXml-Util.html#v%3AcontentElem"
+>Text.XML.HaXml.Util</A
+></TD
+></TR
+><TR
 ><TD CLASS="indexentry" COLSPAN="2"
 >cp</TD
 ></TR
diff --git a/docs/HaXml/doc-index-D.html b/docs/HaXml/doc-index-D.html
--- a/docs/HaXml/doc-index-D.html
+++ b/docs/HaXml/doc-index-D.html
@@ -386,6 +386,14 @@
 ></TD
 ></TR
 ><TR
+><TD CLASS="indexentry"
+>docContent</TD
+><TD CLASS="indexlinks"
+><A HREF="Text-XML-HaXml-Util.html#v%3AdocContent"
+>Text.XML.HaXml.Util</A
+></TD
+></TR
+><TR
 ><TD CLASS="indexentry" COLSPAN="2"
 >doctypedecl</TD
 ></TR
diff --git a/docs/HaXml/doc-index-T.html b/docs/HaXml/doc-index-T.html
--- a/docs/HaXml/doc-index-T.html
+++ b/docs/HaXml/doc-index-T.html
@@ -1103,6 +1103,14 @@
 ></TR
 ><TR
 ><TD CLASS="indexentry"
+>tagTextContent</TD
+><TD CLASS="indexlinks"
+><A HREF="Text-XML-HaXml-Util.html#v%3AtagTextContent"
+>Text.XML.HaXml.Util</A
+></TD
+></TR
+><TR
+><TD CLASS="indexentry"
 >tagWith</TD
 ><TD CLASS="indexlinks"
 ><A HREF="Text-XML-HaXml-Combinators.html#v%3AtagWith"
diff --git a/docs/HaXml/index.html b/docs/HaXml/index.html
--- a/docs/HaXml/index.html
+++ b/docs/HaXml/index.html
@@ -309,6 +309,16 @@
 ></TR
 ><TR
 ><TD STYLE="padding-left: 1.25em;width: 44em"
+><A HREF="Text-XML-HaXml-Util.html"
+>Text.XML.HaXml.Util</A
+></TD
+><TD
+></TD
+><TD
+></TD
+></TR
+><TR
+><TD STYLE="padding-left: 1.25em;width: 44em"
 ><A HREF="Text-XML-HaXml-Validate.html"
 >Text.XML.HaXml.Validate</A
 ></TD
diff --git a/docs/HaXml/src/Text/XML/HaXml/Util.html b/docs/HaXml/src/Text/XML/HaXml/Util.html
new file mode 100644
--- /dev/null
+++ b/docs/HaXml/src/Text/XML/HaXml/Util.html
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<pre><a name="(line1)"></a><font color=Blue>{- |
+<a name="(line2)"></a> - Only a shmall module containing some helper functions to extract xml content
+<a name="(line3)"></a> - I would have added this to Types but I've put it into an additional module
+<a name="(line4)"></a> - to avoid circular references (Verbatim &lt;-&gt; Types)
+<a name="(line5)"></a>-}</font>
+<a name="(line6)"></a>
+<a name="(line7)"></a><font color=Green><u>module</u></font> Text<font color=Cyan>.</font>XML<font color=Cyan>.</font>HaXml<font color=Cyan>.</font>Util
+<a name="(line8)"></a>  <font color=Cyan>(</font>
+<a name="(line9)"></a>  <font color=Blue>-- ** utility functions to access XML content</font>
+<a name="(line10)"></a>    docContent
+<a name="(line11)"></a>  <font color=Cyan>,</font> contentElem
+<a name="(line12)"></a>  <font color=Cyan>,</font> attrs
+<a name="(line13)"></a>  <font color=Cyan>,</font> tagTextContent
+<a name="(line14)"></a>  <font color=Cyan>)</font> <font color=Green><u>where</u></font>
+<a name="(line15)"></a>
+<a name="(line16)"></a><font color=Green><u>import</u></font> Text<font color=Cyan>.</font>XML<font color=Cyan>.</font>HaXml<font color=Cyan>.</font>Posn
+<a name="(line17)"></a><font color=Green><u>import</u></font> Text<font color=Cyan>.</font>XML<font color=Cyan>.</font>HaXml<font color=Cyan>.</font>Types
+<a name="(line18)"></a><font color=Green><u>import</u></font> Text<font color=Cyan>.</font>XML<font color=Cyan>.</font>HaXml<font color=Cyan>.</font>Verbatim
+<a name="(line19)"></a>
+<a name="(line20)"></a><a name="docContent"></a><font color=Blue>-- get the main element of the document so that you can apply CFilters directly</font>
+<a name="(line21)"></a><font color=Blue>-- i is typically (posInNewCxt "filename" Nothing) </font>
+<a name="(line22)"></a>docContent <font color=Red>::</font> i <font color=Red>-&gt;</font> Document i <font color=Red>-&gt;</font> Content i
+<a name="(line23)"></a>docContent i <font color=Cyan>(</font>Document <font color=Green><u>_</u></font> <font color=Green><u>_</u></font> e <font color=Green><u>_</u></font><font color=Cyan>)</font> <font color=Red>=</font> CElem e i
+<a name="(line24)"></a>
+<a name="(line25)"></a><a name="contentElem"></a><font color=Blue>-- if you know that your CFilter returns a tag your can use this function to get the tag Element </font>
+<a name="(line26)"></a>contentElem <font color=Red>::</font>  Content i <font color=Red>-&gt;</font> Element i
+<a name="(line27)"></a>contentElem <font color=Cyan>(</font>CElem e <font color=Green><u>_</u></font><font color=Cyan>)</font> <font color=Red>=</font> e
+<a name="(line28)"></a>contentElem <font color=Green><u>_</u></font> <font color=Red>=</font> error <font color=Magenta>"content is not a CElem"</font>
+<a name="(line29)"></a><a name="attrs"></a>attrs <font color=Red>::</font> Element i <font color=Red>-&gt;</font> <font color=Red>[</font>Attribute<font color=Red>]</font>
+<a name="(line30)"></a>attrs <font color=Cyan>(</font> Elem <font color=Green><u>_</u></font> attrs <font color=Green><u>_</u></font> <font color=Cyan>)</font> <font color=Red>=</font> attrs
+<a name="(line31)"></a><a name="tagTextContent"></a>tagTextContent <font color=Cyan>(</font><font color=Cyan>(</font>CElem <font color=Cyan>(</font>Elem <font color=Green><u>_</u></font> <font color=Green><u>_</u></font> cs<font color=Cyan>)</font> <font color=Green><u>_</u></font><font color=Cyan>)</font><font color=Cyan>)</font> <font color=Red>=</font> concatMap verbatim cs 
+<a name="(line32)"></a>
+<a name="(line33)"></a><font color=Blue>{-
+<a name="(line34)"></a>  now you can extract an attribute quite easily:
+<a name="(line35)"></a>    let doc = "&lt;xml&gt;&lt;a&gt;&lt;b a=\"x\"&gt;content&lt;/b&gt;&lt;/a&gt;&lt;/xml&gt;"
+<a name="(line36)"></a>    let b = head $ xtract id "a/b" $ docContent (posInNewCxt filename Nothing) $ xmlParse filename doc
+<a name="(line37)"></a>    putStrLn $ "attr a of tag b" ++ (show $ lookup "a" $  attrs $ contentElem b)
+<a name="(line38)"></a>    putStrLn $ "text content of b :" ++ tagTextContent b
+<a name="(line39)"></a>  still (too) much code IMHO
+<a name="(line40)"></a>-}</font>
+<a name="(line41)"></a>
+</pre>
+</html>
diff --git a/docs/changelog.html b/docs/changelog.html
--- a/docs/changelog.html
+++ b/docs/changelog.html
@@ -20,7 +20,7 @@
      in the XtractLazy tool.
 <li> Version 1.19.2 updates the Cabal file to enable HaXml to build with both
      ghc-6.6.x and ghc-6.8.x.
-<li> Version 1.19.3 fixes an incompatibility with some versions of the
+<li> Version 1.19.4 fixes an incompatibility with some versions of the
      Bytestring package.  Also has a bugfix in the DTD validator, and
      adds some new utility functions in Text.XML.HaXml.Util.
 </ul>
diff --git a/docs/index.html b/docs/index.html
--- a/docs/index.html
+++ b/docs/index.html
@@ -132,11 +132,11 @@
 <center><h3><a name="download">Downloads</a></h3></center>
 <p>
 <b>Development versions:</b><br>
-HaXml-1.19.3, release date 2008.06.17<br>
+HaXml-1.19.4, release date 2008.06.17<br>
 From <a href="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HaXml">Hackage</a><br>
 By HTTP:
-<a href="http://www.cs.york.ac.uk/fp/HaXml-devel/HaXml-1.19.3.tar.gz">.tar.gz</a>,
-<a href="http://www.cs.york.ac.uk/fp/HaXml-devel/HaXml-1.19.3.zip">.zip</a>.
+<a href="http://www.cs.york.ac.uk/fp/HaXml-devel/HaXml-1.19.4.tar.gz">.tar.gz</a>,
+<a href="http://www.cs.york.ac.uk/fp/HaXml-devel/HaXml-1.19.4.zip">.zip</a>.
 <br>
 By FTP: 
 <a href="ftp://ftp.cs.york.ac.uk/pub/haskell/HaXml/">
@@ -203,7 +203,7 @@
 <center><h3><a name="news">Recent news</a></h3></center>
 
 <p>
-Version 1.19.3 has some minor bugfixes to increase compatibility with the
+Version 1.19.4 has some minor bugfixes to increase compatibility with the
 ByteString package.<br>
 Version 1.19.2 updates the Cabal file to enable HaXml to build with both
 ghc-6.6.x and ghc-6.8.x.<br>
diff --git a/src/Makefile b/src/Makefile
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,5 +1,5 @@
 SOFTWARE = HaXml
-VERSION = 1.19.3
+VERSION = 1.19.4
 
 LIBSRCS = \
 	Text/XML/HaXml.hs Text/XML/HaXml/Combinators.hs Text/XML/HaXml/Lex.hs \
diff --git a/src/Text/XML/HaXml/Util.hs b/src/Text/XML/HaXml/Util.hs
new file mode 100644
--- /dev/null
+++ b/src/Text/XML/HaXml/Util.hs
@@ -0,0 +1,41 @@
+{- |
+ - Only a shmall module containing some helper functions to extract xml content
+ - I would have added this to Types but I've put it into an additional module
+ - to avoid circular references (Verbatim <-> Types)
+-}
+
+module Text.XML.HaXml.Util
+  (
+  -- ** utility functions to access XML content
+    docContent
+  , contentElem
+  , attrs
+  , tagTextContent
+  ) where
+
+import Text.XML.HaXml.Posn
+import Text.XML.HaXml.Types
+import Text.XML.HaXml.Verbatim
+
+-- get the main element of the document so that you can apply CFilters directly
+-- i is typically (posInNewCxt "filename" Nothing) 
+docContent :: i -> Document i -> Content i
+docContent i (Document _ _ e _) = CElem e i
+
+-- if you know that your CFilter returns a tag your can use this function to get the tag Element 
+contentElem ::  Content i -> Element i
+contentElem (CElem e _) = e
+contentElem _ = error "content is not a CElem"
+attrs :: Element i -> [Attribute]
+attrs ( Elem _ attrs _ ) = attrs
+tagTextContent ((CElem (Elem _ _ cs) _)) = concatMap verbatim cs 
+
+{-
+  now you can extract an attribute quite easily:
+    let doc = "<xml><a><b a=\"x\">content</b></a></xml>"
+    let b = head $ xtract id "a/b" $ docContent (posInNewCxt filename Nothing) $ xmlParse filename doc
+    putStrLn $ "attr a of tag b" ++ (show $ lookup "a" $  attrs $ contentElem b)
+    putStrLn $ "text content of b :" ++ tagTextContent b
+  still (too) much code IMHO
+-}
+
