def document_info_element doc, info_tag_prefix, use_info_tag_prefix = false
info_tag_prefix = '' unless use_info_tag_prefix
result = []
result << %(<#{info_tag_prefix}info>)
result << document_title_tags(doc.doctitle :partition => true, :use_fallback => true) unless doc.notitle
if (date = (doc.attr? 'revdate') ? (doc.attr 'revdate') : ((doc.attr? 'reproducible') ? nil : (doc.attr 'docdate')))
result << %(<date>#{date}</date>)
end
if doc.has_header?
if doc.attr? 'author'
if (authorcount = (doc.attr 'authorcount').to_i) < 2
result << (author_element doc)
result << %(<authorinitials>#{doc.attr 'authorinitials'}</authorinitials>) if doc.attr? 'authorinitials'
else
result << '<authorgroup>'
authorcount.times do |index|
result << (author_element doc, index + 1)
end
result << '</authorgroup>'
end
end
if (doc.attr? 'revdate') && ((doc.attr? 'revnumber') || (doc.attr? 'revremark'))
result << %(<revhistory>
<revision>)
result << %(<revnumber>#{doc.attr 'revnumber'}</revnumber>) if doc.attr? 'revnumber'
result << %(<date>#{doc.attr 'revdate'}</date>) if doc.attr? 'revdate'
result << %(<authorinitials>#{doc.attr 'authorinitials'}</authorinitials>) if doc.attr? 'authorinitials'
result << %(<revremark>#{doc.attr 'revremark'}</revremark>) if doc.attr? 'revremark'
result << %(</revision>
</revhistory>)
end
unless (head_docinfo = doc.docinfo).empty?
result << head_docinfo
end
result << %(<orgname>#{doc.attr 'orgname'}</orgname>) if doc.attr? 'orgname'
end
result << %(</#{info_tag_prefix}info>)
if doc.doctype == 'manpage'
result << '<refmeta>'
result << %(<refentrytitle>#{doc.attr 'mantitle'}</refentrytitle>) if doc.attr? 'mantitle'
result << %(<manvolnum>#{doc.attr 'manvolnum'}</manvolnum>) if doc.attr? 'manvolnum'
result << '</refmeta>'
result << '<refnamediv>'
result << %(<refname>#{doc.attr 'manname'}</refname>) if doc.attr? 'manname'
result << %(<refpurpose>#{doc.attr 'manpurpose'}</refpurpose>) if doc.attr? 'manpurpose'
result << '</refnamediv>'
end
result * EOL
end