public Element redirectToDom ( Closure c ) { SAXContentHandler sc = new SAXContentHandler ( ) ; with ( new XMLOutput ( sc ) , c ) ; return sc . getDocument ( ) . getRootElement ( ) ; }
Captures the XML fragment generated by the given closure into dom4j DOM tree and return the root element .