add document element and outputAttributes