xml2man program was designed to convert Man Page Generation Language (MPGL) XML files into mdoc-based manual pages. The MPGL is a fairly direct translation of mdoc to XML.