pretty print xml using xmllint command:
xmllint --format xml_file.xml > pretty_xml_file.xml
and now you can open pretty_xml_file.xml in vi or your favorite editor