When I write .xml files in Eclipse, I often have to manually indent code. For example
Ctrl+Shift+F
Will do it for you, and you can configure it in
Window -> Preferences -> XML -> Xml Files -> Editor