Window -> Preferences, then XML -> XML Files -> Editor. There is a search box above the preferences tree, very useful when you want to find where something is configured.
Note that it may be some other editor is used, e.g. if you’re editing a build.xml file and have the Ant integration. In this specific case you’d set up the formatting at Window -> Preferences, Ant -> Editor -> Formatter. In similiar cases you need to search for the corresponding options for that editor yourself.