Hi Hilary,
you're right, I meant Infopath 2013, I fixed my message.
My issue is not so much to fix the formatting when I need, I can do it with an editor as you propose or xmllint command. The point is that we manage several tens of xml forms in version control.
We can't ask people in our team to re-format XML files after editing forms in Infopath but would like Infopath to preserve a good multiline formatting. Long lines Infopath format makes diff but also merge operations very difficult.
Alain