Type format
in the quick search box above the TreeView in eclipse preferences and the preferences will be zoomed out to show only format preferences. You easily find
XML -> XML Files -> Editor
There are a few settings you can tweak here.
source
to share