Approach 1
Type below the commands in editing the xml file
:%s/></>\r
Approach 2
Map the key and press it when editing the xml file. Here take an example by using key F6:
map :%s/></>\r:0=:$
Reference
http://vim.wikia.com/wiki/Pretty-formatting_XML
http://vim.wikia.com/wiki/VimTip551