InDesign has a native "Export XML" option, but that requires that you tag each separate item as an "XML item". Some of this can be automated, using "Map Styles to Tags". I don't have any experience with it, positive or negative, but if you exclusively used paragraph and character styles to layout your text it should be straightforward.
Fastest way to get re-usable text in a not too difficult to parse file format is to export as Tagged Text. It's not really proper XML, but it may be Close Enough; if the above route is too complickated, try this (and send your publisher a test file).
I've been trying to find information on how such a XML should look. Are there any code conventions for it? Most of the issues on this forum concerns importing xml files for use in indesign - but what I'm wondering is what I must think of when exporting XML files that other people will use?
There are no "conventions". XML itself only has some very basic requirements (the way of writing element and attribute tags, correct nesting, some special characters that may not be used in plain text; that sort of things). So you can make up your own set of tags, or, to not confuse your receiving party, use a well-known set of tags such as XHTML (ie., <p> is for Paragraph, <i> is for Italic, and so on) or DocBook. There are also Scripture specific schema's of XML; http://ebible.org/usfx/ is one found with a quick Google.
You might find some useful hints about both footnotes and XML in the 2011 thread Footnotes not support with XML?; for footnotes in particular, note Jongware’s contribution. Wandering off topic, David Blatner’s recent This Week in InDesign Articles, Number 99 links to a discussion “Has XML failed book publishing?”
Thanks for your reply. I had no idea that these XML schemas existed. I've been looking closer at both OSIS and USFX (which you linked to). A problem for me with both of these standards is that some information that should be included in the text is instead included as attibutes in tags. Normally in the Bible you will have a verse number (usually in superscript) followed by the text in that verse. These standards include chapter <c> and verse <v> numbers like this:
<c id="1" />
<p><v id="1" />In the beginning God created the heavens and the earth.
<v id="2" />...
Is there any smooth way to import this structure into inDesign and transform the attributes of the <c>-tag and <v>-tag into numbers with a given character style? Also can you do the opposite when exporting to XML (converting text of a given character style into an attribute)?