Officially, an XML declaration requires its attributes to be in the order: version, encoding, and then standalone.
See for instance: https://xmlwriter.net/xml_guide/xml_declaration.shtml.
Unfortunately, jtm seems to store all attributes in a data structure that does not preserve order, which is
perfectly all right for any regular element's attributes.
A simple fix is to ensure that upon output of the XML declaration, its attributes are forced to be in the correct order.