title: How to generate .proto file from FileDescriptor
body: <p>I am generating a <code>protobuf.Descriptors.FileDescriptor</code>from an XML File to define the interface between different machines. The <code>FileDescriptor</code>is really handy to define the protocol and use it for late-binded calls. Now I also want to be able to generate the appropriate <code>.proto</code> file but I only found the <code>DebugString()</code> method in the C++ implementation <a href="https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.descriptor#Descriptor.DebugString.details" rel="noreferrer">link</a>.</p>
  
  <p>As an easy workaround, I can of course do the <code>.proto</code> file generation by hand as done e.g. <a href="https://github.com/tranchis/xsd2thrift/blob/master/src/main/java/com/github/tranchis/xsd2thrift/marshal/ProtobufMarshaller.java" rel="noreferrer">here</a> but that destroys a lot of the convenience of using the <code>FileDescriptor</code>class.</p>
  
  <p>The question: Is there an easier way of generating the <code>.proto</code> file than doing it by hand? (I wouldn't consider wrapping the C++ class to be a clean solution either)</p>