This is plugin for IntelliJ Idea that allows you to sort pom.xml file. Simply open pom.xml rightclick on it to bring the context menu up and click "Sort POM".
Downloads are hosted at IntelliJ's plugins repository.
Configuration:
You can configure sorting of each tag simply by entering tag name and selecting ordering type. Alternatively you can enter tag path like this:
/project/target
/*/target
**/target