Use xhtmlrenderer-1.0.1-SNAPSHOT, which has getLayoutContext() method