diff --git a/Data/XCB/FromXML.hs b/Data/XCB/FromXML.hs
--- a/Data/XCB/FromXML.hs
+++ b/Data/XCB/FromXML.hs
@@ -28,9 +28,7 @@
 import qualified Data.Map as Map
 import Data.Maybe
 
-import Control.Applicative ((<$>))
 import Control.Monad
-import Control.Monad.Fail (MonadFail)
 import Control.Monad.Reader
 
 import System.IO (openFile, IOMode (ReadMode), hSetEncoding, utf8, hGetContents)
@@ -397,6 +395,11 @@
     | el `named` "fd" = do
         name <- el `attr` "name"
         return $ Fd name
+
+    | el `named` "length" = do
+        expr <- firstChild el >>= expression
+        let typ = mkType "CARD32"
+        return $ Length typ expr
 
     | otherwise = let name = elName el
                   in error $ "I don't know what to do with structelem "
diff --git a/Data/XCB/Pretty.hs b/Data/XCB/Pretty.hs
--- a/Data/XCB/Pretty.hs
+++ b/Data/XCB/Pretty.hs
@@ -149,6 +149,8 @@
                       ,text mname
                       ,text lname
                       ]
+    toDoc (Length _ expr)
+        = text "length" <+> parens (toDoc expr)
 
 
 instance Pretty a => Pretty (GenBitCase a) where
diff --git a/Data/XCB/Types.hs b/Data/XCB/Types.hs
--- a/Data/XCB/Types.hs
+++ b/Data/XCB/Types.hs
@@ -102,6 +102,7 @@
     | Switch Name (Expression typ) (Maybe Alignment) [GenBitCase typ]
     | Doc (Maybe String) (Map Name String) [(String, String)]
     | Fd String
+    | Length typ (Expression typ)
  deriving (Show, Functor)
 
 data GenBitCase typ
diff --git a/xcb-types.cabal b/xcb-types.cabal
--- a/xcb-types.cabal
+++ b/xcb-types.cabal
@@ -1,6 +1,6 @@
 Name:         xcb-types
-Version:      0.10.0
-Cabal-Version:  >= 1.6
+Version:      0.11.0
+Cabal-Version:  >= 1.10
 Synopsis:     Parses XML files used by the XCB project
 Description:   This package provides types which mirror the structures
   used in the XCB code generation XML files.
@@ -41,5 +41,6 @@
                   Data.XCB.FromXML
 
  Other-modules:   Data.XCB.Utils
+ Default-Language: Haskell2010
 
  Ghc-Options:     -Wall
