Would AI be appropriate for converting unstructured text into an XML? I need to understand whether it is better to use AI algorithms (ML, DL, etc.) instead of the classic parser (based onto grammars with regular expression and automaton) for the following task: structuring in XML an unstructured plain text. 

The text is a legal document, so the structure is well defined and a classic parser could do a good job.

In the case AI could be a viable way, what would be an appropriate approach for the task?
A rule-based approach will guarantee a correct result, and it works perfectly fine. On the other hand, an AI based approach will introduce errors as AI cannot produce result with 100% accuracy, and also decreasing speed. As the document you are processing is a legal document, it would be better to use a parser as AI is only adding unnecessary wasted time and non-accurate results.

Hope I can help you.