records: prettify MarcXML on creation

* Makes MarcXML more readable and properly indented.

* Turns [this](http://pastebin.com/cYRE2s68) into [this](http://pastebin.com/eqZ92A47).

See #1926.
@pedrogaudencio do you think it could worth it to add argument `tabsize=4` to `legacy_export_as_marc`?