xmlformat is a configurable formatter (or "pretty-printer") for XML documents. It provides control over indentation, line-breaking, and text wrapping. These properties can be defined on a per-element basis.
xmlformat 1.04 provides improved diagnostic information when a document is not well-formed. (Prints line and token number, and stack trace).
Michael Smith was kind enough to review xmlformat in an article at xmlhack.com.
Gentoo ebuild page
Ruby Application Archive page