Is there a way of saying in lxml:
“if the element is <w> or <pc>, indent it by two spaces from the left margin, else indent the element by six spaces” ?
In the long texts I deal with, the typical hierarchical indentation doesn’t help much with readability. On the other hand, some <w> elements with their attributes can take up a whole line or more, so there is an advantage of keeping them as close to the beginning of a line. In my project, the readability of the printed XML is a non-trivial advantage: there is a lot of data checking and manual editing.
Martin Mueller