***** xml-mode
<outermost>
<inner1><inner2>
<inner3>Duh</inner3>
</inner2>
</inner1>
</outermost>
***** nxml-mode
<outermost>
<inner1><inner2>
<inner3>Duh</inner3>
</inner2>
</inner1>
</outermost>
IMO, neither is great (both are ugly and confusing). I've never seen XML
indented like either of those (except when it wasn't formatted at all).
FWIW, I use this:
<outermost>
<inner1><inner2>
<inner3>Duh</inner3>
</inner2>
</inner1>
</outermost>
IOW: 1. Align opening and closing tags. 2. Indent just enough so that nested
tags start after the </ of their parent.
Why? Because (1) you need to be able to easily find corresponding tags and
(2) XML is verbose, so the less indentation the better. You could indent
only one space, but I think it's more readable with two.
Another possibility is what we (most of us) use in Lisp - avoid starting
lines with closing tags:
<outermost>
<inner1><inner2>
<inner3>Duh</inner3></inner2></inner1>
<inner1>some more</inner1></outermost>
That can also work well in some contexts.
I present lots of XML in doc everyday. I haven't found anything more
readable than just indenting two spaces and aligning the corresponding
element tags. I also align attributes. But I never, ever introduce or change
significant whitespace, such as that within a text() node, if I can avoid
it. For example, I never indent the text here:
<foo>some text that is too
long for a printed line</foo>
That should never be changed by automatic indentation to, say, this:
<foo>some text that is too
long for a printed line</foo>
or this:
<foo>some text that is too
long for a printed line
</foo>