Eclipse should be configured to use spaces (not tabs) and an indentation of 2 spaces is used for XML-like code. Line width is 120.
See Window > Preferences > XML > XML Files > Editor.
Option "Insert whitespace before before closing empty tags" should also be checked.
XHTML files do not support a default formatting that suits Eclipse, as it gets confused between namespaced tags (JSF tags for instance) and others (standard HTML tags for instance).
But formatting is similar to XML files: use an indentation of 2 spaces.