Added the possibility to build document contents either by passing a Map
or an XContentBuilder