http://www.intellij.net/tracker/idea/viewSCR?publicId=12597
I like to have my XML and Java code to have different indentation levels. For Java I like to have four (4) spaces at each indentation level. It works because Java usually doesn't go beyond a certain number of indentations. XML, on the other hand, can nest much more deeply than Java. Because of that I like to have two (2) spaces at each indentation. It keeps the XML readable, and minimizes the chance of wrapping.
For XML formatting, things I would like to see are these:
Indentation Style: Tabs or Spaces
Indentation Depth: number of spaces
Align Attributes When Wrapped: check box
Indent Free Text: check box
Collapse Elements: check box
The three check boxes would treat XML code like this:
Align Attributes When Wrapped: No
[pre]
<big-long-element with="lot's of attributes" and="another"
foo="bar"/>
[/pre]
Align Attributes When Wrapped: Yes
[pre]
<big-long-element with="lot's of attributes" and="another"
foo="bar"/>
[/pre]
Indent Free Text: No
[pre]
<element>
<child>
This is my free text that is a child of the child element.
</child>
<child>
<![CDATA[
This is CDATA encapsulated text.
Spacing is important, so it should never be
reformatted.
]]>
</child>
</element>
[/pre]
Indent Free Text: Yes
[pre]
<element>
<child>
This is my free text that is a child of the child
element.
</child>
<child>
<![CDATA[
This is CDATA encapsulated text.
Spacing is important, so it should never be
reformatted.
]]>
</child>
</element>
[/pre]
Collapse Elements: No
[pre]
<ol>
<li>
This is some long text that will wrap lines. It will
never be collapsed.
</li>
<li>
Collapsable short text
</li>
</ol>
[/pre]
Collapse Elements: Yes
[pre]
<ol>
<li>
This is some long text that will wrap lines. It will
never be collapsed.
</li>
<li>Collapsable short text</li>
</ol>
[/pre]
I am shure there are other options for XML formatting, but that is my short list.