DOM insertion that respects indentation