If you want to convert your PDF to XML, then you can use the ExportPDF option in AEM which will allow you to convert any native PDF to XML format.
You can review the sample code at[0] to get the code to convert the document in XML. Additionally you can use the "exportPDF" method[1] in which you can pass the "ConvertPDFFormatType" argument[2] to get the desired output XML
[0] https://experienceleague.adobe.com/en/docs/experience-manager-65/content/forms/developer-reference/programming-aem-forms-jee/java-api-quick-start-code-examples/generate-pdf-service-java-api#quick-start-soap-mode-converting-a-pdf-document-to-an-rtf-file-using-the-java-api-soap-mode
[1] https://developer.adobe.com/experience-manager/reference-materials/6-5/forms/programlc/javadoc/com/adobe/livecycle/generatepdf/client/GeneratePdfServiceClient.html#:~:text=Class%20GeneratePdfServiceClient&text=Provides%20methods%20for%20creating%20PDF,PDF%20in%20Programming%20with%20Forms.
[2] https://developer.adobe.com/experience-manager/reference-materials/6-5/forms/programlc/javadoc/com/adobe/livecycle/generatepdf/client/ConvertPDFFormatType.html
Thanks
Pranay




