add drop root mode support
add xml head in writer