Moved indent stuff from xml to generic writer.