* @throws UnsupportedEncodingException
*/
public HttpEntity encodeXML( Object xml, Object contentType )
throws UnsupportedEncodingException {
if ( xml instanceof Closure ) {
StreamingMarkupBuilder smb = new StreamingMarkupBuilder();
xml = smb.bind( xml );
}
if ( contentType == null ) contentType = ContentType.XML;
return createEntity( contentType, xml.toString() );
}