How to make PDF invoice with embeded XML compatible with UBL standard

Hey Guys,

I am working on Saudi Arabia Fatoora system which is the same of UBL standard and I created a PDF invoice by using mPDF library but I could not understand how to make it in XML format with UBL standard.

Any one can explain it to me please