Using PHP programming Language.
<ns10:Invoice xmlns:ns10=“urn:oasis:names:specification:ubl:schema:xsd:Invoice-2” xmlns:cac=“urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2” xmlns:cbc=“urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2” xmlns:ds=“XML-Signature Syntax and Processing” xmlns:ext=“urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2” xmlns:sac=“urn:oasis:names:specification:ubl:schema:xsd:SignatureAggregateComponents-2” xmlns:sbc=“urn:oasis:names:specification:ubl:schema:xsd:SignatureBasicComponents-2” xmlns:sig=“urn:oasis:names:specification:ubl:schema:xsd:CommonSignatureComponents-2” xmlns:xades=“Assigned ETSI XML URIs”>
ext:UBLExtensions
ext:UBLExtension
ext:ExtensionURIurn:oasis:names:specification:ubl:dsig:enveloped:xades</ext:ExtensionURI>
ext:ExtensionContent
sig:UBLDocumentSignatures
sac:SignatureInformation
cbc:IDurn:oasis:names:specification:ubl:signature:1</cbc:ID>
sbc:ReferencedSignatureIDurn:oasis:names:specification:ubl:signature:Invoice</sbc:ReferencedSignatureID>
<ds:Signature Id=“signature”>
ds:SignedInfo
<ds:CanonicalizationMethod Algorithm=“Canonical XML 1.1”/>
<ds:SignatureMethod Algorithm=“xmldsig-more namespace”/>
<ds:Reference Id=“invoiceSignedData” URI=“”>
ds:Transforms
<ds:Transform Algorithm=“XML Path Language (XPath)”>
ds:XPathnot(//ancestor-or-self::ext:UBLExtensions)</ds:XPath>
</ds:Transform>
<ds:Transform Algorithm=“XML Path Language (XPath)”>
ds:XPathnot(//ancestor-or-self::cac:Signature)</ds:XPath>
</ds:Transform>
<ds:Transform Algorithm=“XML Path Language (XPath)”>
ds:XPathnot(//ancestor-or-self::cac:AdditionalDocumentReference[cbc:ID=‘QR’])</ds:XPath>
</ds:Transform>
<ds:Transform Algorithm=“Canonical XML 1.1”/>
</ds:Transforms>
<ds:DigestMethod Algorithm=“XML Encryption Syntax and Processing”/>
ds:DigestValueZGViNTYzN2U5YWRmZmI3MWIyMzg5OGQzZmIzYWFhNjQ4MmYyODg1YTliNzVhY2JjMWE5ZmI1NDJjZGY2NzdhZg==</ds:DigestValue>
</ds:Reference>
<ds:Reference Type=“XML-Signature Syntax and Processing” URI=“#xadesSignedProperties”>
<ds:DigestMethod Algorithm=“XML Encryption Syntax and Processing”/>
ds:DigestValue3YAoquDC3a454aPyHqnDeRtkEW2N+8GrhKWm708H3X4=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
ds:SignatureValueMEUCIC8FvfSrutvKatmGueI+0Ni+9LZ4atrZO8VPWnkbYENxAiEAliIRFEUZy1IG0lr8o9bz8tWPqFUc+9I6U1vNGZ7BKeE=</ds:SignatureValue>
ds:KeyInfo
ds:X509Data
ds:X509CertificateMIICKjCCAdCgAwIBAgIGAZS4GXTJMAoGCCqGSM49BAMCMBUxEzARBgNVBAMMCmVJbnZvaWNpbmcwHhcNMjUwMTMwMTY0NDE4WhcNMzAwMTI5MjEwMDAwWjBoMR4wHAYDVQQDDBVlbGFiZXJwLnNldHJhZGVlei5jb20xFjAUBgNVBAsMDVJpeWFkaCBCcmFuY2gxITAfBgNVBAoMGFN5c3RlbXMgRXhwZXJ0IENvIGZvciBJVDELMAkGA1UEBhMCU0EwVjAQBgcqhkjOPQIBBgUrgQQACgNCAAQ/pz+FnoSMN9O8rnVUmR/1tSygbBisjHdgtyM3ftvZb5b/Jb3f5w+blpGw85ss/JNFKQQ6d/t32SB5cQKsvYB+o4G7MIG4MAwGA1UdEwEB/wQCMAAwgacGA1UdEQSBnzCBnKSBmTCBljE7MDkGA1UEBAwyMS1lbGFiZXJwLnNldHJhZGVlei5jb218Mi1FR1MtWDEwMHwzLTRHREpBNTQ1NjQ1NkQxHzAdBgoJkiaJk/IsZAEBDA8zMTEwNjg2MTQ2MDAwMDMxDTALBgNVBAwMBDExMDAxDzANBgNVBBoMBlJpeWFkaDEWMBQGA1UEDwwNSVQgRGVwYXJ0bWVudDAKBggqhkjOPQQDAgNIADBFAiEAtP/Bd9k+XyQd9BWKvg9mLhnj80bOxHKugTnvPjl/zI4CICT5lBz+U8yD07exspKArVqn/zqEQXFJxTaObywDvwl2</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
ds:Object
<xades:QualifyingProperties xmlns:xades=“Assigned ETSI XML URIs” Target=“signature”>
<xades:SignedProperties Id=“xadesSignedProperties”>
xades:SignedSignatureProperties
xades:SigningTime2025-02-04T10:06:40Z</xades:SigningTime>
xades:SigningCertificate
xades:Cert
xades:CertDigest
<ds:DigestMethod Algorithm=“XML Encryption Syntax and Processing”/>
ds:DigestValueYzJkYmE4ZjE0YzBmN2JhZjhmYTZlMjVjYzgxMDQ2MGIzOWM0YzJkNjU3ZTE3NDBjMjFhODRmMzhlY2Q0NTllMw==</ds:DigestValue>
</xades:CertDigest>
xades:IssuerSerial
ds:X509IssuerNameCN=eInvoicing,DC=extgazt, DC=gov, DC=local</ds:X509IssuerName>
ds:X509SerialNumber1738255463625</ds:X509SerialNumber>
</xades:IssuerSerial>
</xades:Cert>
</xades:SigningCertificate>
</xades:SignedSignatureProperties>
</xades:SignedProperties>
</xades:QualifyingProperties>
</ds:Object>
</ds:Signature>
</sac:SignatureInformation>
</sig:UBLDocumentSignatures>
</ext:ExtensionContent>
</ext:UBLExtension>
</ext:UBLExtensions>
cbc:ProfileIDreporting:1.0</cbc:ProfileID>
cbc:IDSALE26719</cbc:ID>
cbc:UUID19de0aea-5973-4b58-81f2-73b25b9580e0</cbc:UUID>
cbc:IssueDate2025-01-31</cbc:IssueDate>
cbc:IssueTime11:29:00</cbc:IssueTime>
<cbc:InvoiceTypeCode name=“0100000”>388</cbc:InvoiceTypeCode>
cbc:DocumentCurrencyCodeSAR</cbc:DocumentCurrencyCode>
cbc:TaxCurrencyCodeSAR</cbc:TaxCurrencyCode>
cac:AdditionalDocumentReference
cbc:IDICV</cbc:ID>
cbc:UUID1</cbc:UUID>
</cac:AdditionalDocumentReference>
cac:AdditionalDocumentReference
cbc:IDPIH</cbc:ID>
cac:Attachment
<cbc:EmbeddedDocumentBinaryObject mimeCode=“text/plain”>NWZlY2ViNjZmZmM4NmYzOGQ5NTI3ODZjNmQ2OTZjNzljMmRiYzIzOWRkNGU5MWI0NjcyOWQ3M2EyN2ZiNTdlOQ==</cbc:EmbeddedDocumentBinaryObject>
</cac:Attachment>
</cac:AdditionalDocumentReference>
cac:AdditionalDocumentReference
cbc:IDQR</cbc:ID>
cac:Attachment
<cbc:EmbeddedDocumentBinaryObject mimeCode=“text/plain”>ARNBTCBBU1NJIFRSQURJTkcgRVNUAg8zMTEwNjg2MTQ2MDAwMDMDFDIwMjUtMDEtMzFUMTE6Mjk6MDBaBAUyOC4wMAUEMy42NQZYWkdWaU5UWXpOMlU1WVdSbVptSTNNV0l5TXpnNU9HUXpabUl6WVdGaE5qUTRNbVl5T0RnMVlUbGlOelZoWTJKak1XRTVabUkxTkRKalpHWTJOemRoWmc9PQdgTUVVQ0lDOEZ2ZlNydXR2S2F0bUd1ZUkrME5pKzlMWjRhdHJaTzhWUFdua2JZRU54QWlFQWxpSVJGRVVaeTFJRzBscjhvOWJ6OHRXUHFGVWMrOUk2VTF2TkdaN0JLZUU9CFgwVjAQBgcqhkjOPQIBBgUrgQQACgNCAAQ/pz+FnoSMN9O8rnVUmR/1tSygbBisjHdgtyM3ftvZb5b/Jb3f5w+blpGw85ss/JNFKQQ6d/t32SB5cQKsvYB+CUcwRQIhALT/wXfZPl8kHfQVir4PZi4Z4/NGzsRyroE57z45f8yOAiAk+ZQc/lPMg9O3sbKSgK1ap/86hEFxScU2jm8sA78Jdg==</cbc:EmbeddedDocumentBinaryObject>
</cac:Attachment>
</cac:AdditionalDocumentReference>
cac:Signature
cbc:IDurn:oasis:names:specification:ubl:signature:Invoice</cbc:ID>
cbc:SignatureMethodurn:oasis:names:specification:ubl:dsig:enveloped:xades</cbc:SignatureMethod>
</cac:Signature>
cac:AccountingSupplierParty
cac:Party
cac:PartyIdentification
<cbc:ID schemeID=“CRN”>1234653499</cbc:ID>
</cac:PartyIdentification>
cac:PostalAddress
cbc:StreetNameMuhayil</cbc:StreetName>
cbc:AdditionalStreetNameMuhayil</cbc:AdditionalStreetName>
cbc:BuildingNumber1234</cbc:BuildingNumber>
cbc:PlotIdentification١٢٣٤</cbc:PlotIdentification>
cbc:CitySubdivisionNameMuhayil</cbc:CitySubdivisionName>
cbc:CityNameMuhayil</cbc:CityName>
cbc:PostalZone12345</cbc:PostalZone>
cbc:CountrySubentitySaudi Arabia</cbc:CountrySubentity>
cac:Country
cbc:IdentificationCodeSA</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
cac:PartyTaxScheme
cbc:CompanyID311068614600003</cbc:CompanyID>
cac:TaxScheme
cbc:IDVAT</cbc:ID>
</cac:TaxScheme>
</cac:PartyTaxScheme>
cac:PartyLegalEntity
cbc:RegistrationNameAL ASSI TRADING EST</cbc:RegistrationName>
</cac:PartyLegalEntity>
</cac:Party>
</cac:AccountingSupplierParty>
cac:AccountingCustomerParty
cac:Party
cac:PartyIdentification
<cbc:ID schemeID=“CRN”>1234653499</cbc:ID>
</cac:PartyIdentification>
cac:PostalAddress
cbc:StreetNameReesh</cbc:StreetName>
cbc:AdditionalStreetNameReesh</cbc:AdditionalStreetName>
cbc:BuildingNumber1234</cbc:BuildingNumber>
cbc:PlotIdentification١٢٣٤</cbc:PlotIdentification>
cbc:CitySubdivisionNameMuhayil </cbc:CitySubdivisionName>
cbc:CityNameMuhayil </cbc:CityName>
cbc:PostalZone12345</cbc:PostalZone>
cbc:CountrySubentityKSA</cbc:CountrySubentity>
cac:Country
cbc:IdentificationCodeSA</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
cac:PartyTaxScheme
cbc:CompanyID310726992900003</cbc:CompanyID>
cac:TaxScheme
cbc:IDVAT</cbc:ID>
</cac:TaxScheme>
</cac:PartyTaxScheme>
cac:PartyLegalEntity
cbc:RegistrationNameAbdul Malik Al Ahmari</cbc:RegistrationName>
</cac:PartyLegalEntity>
</cac:Party>
</cac:AccountingCustomerParty>
cac:Delivery
cbc:ActualDeliveryDate2025-01-31</cbc:ActualDeliveryDate>
</cac:Delivery>
cac:PaymentMeans
cbc:PaymentMeansCode30</cbc:PaymentMeansCode>
cbc:InstructionNoteReturned items</cbc:InstructionNote>
</cac:PaymentMeans>
cac:AllowanceCharge
cbc:ChargeIndicatorfalse</cbc:ChargeIndicator>
<cbc:Amount currencyID=“SAR”>0.00</cbc:Amount>
cac:TaxCategory
cbc:IDS</cbc:ID>
cbc:Percent15.00</cbc:Percent>
cac:TaxScheme
cbc:IDVAT</cbc:ID>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:AllowanceCharge>
cac:TaxTotal
<cbc:TaxAmount currencyID=“SAR”>3.65</cbc:TaxAmount>
cac:TaxSubtotal
<cbc:TaxableAmount currencyID=“SAR”>24.35</cbc:TaxableAmount>
<cbc:TaxAmount currencyID=“SAR”>3.65</cbc:TaxAmount>
cac:TaxCategory
cbc:IDS</cbc:ID>
cbc:Percent15.00</cbc:Percent>
cac:TaxScheme
cbc:IDVAT</cbc:ID>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
cac:TaxTotal
<cbc:TaxAmount currencyID=“SAR”>3.65</cbc:TaxAmount>
</cac:TaxTotal>
cac:LegalMonetaryTotal
<cbc:LineExtensionAmount currencyID=“SAR”>24.35</cbc:LineExtensionAmount>
<cbc:TaxExclusiveAmount currencyID=“SAR”>24.35</cbc:TaxExclusiveAmount>
<cbc:TaxInclusiveAmount currencyID=“SAR”>28.00</cbc:TaxInclusiveAmount>
<cbc:AllowanceTotalAmount currencyID=“SAR”>0.00</cbc:AllowanceTotalAmount>
<cbc:PayableAmount currencyID=“SAR”>28.00</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
cac:InvoiceLine
cbc:ID293143</cbc:ID>
cbc:InvoicedQuantity4.0</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID=“SAR”>24.35</cbc:LineExtensionAmount>
cac:TaxTotal
<cbc:TaxAmount currencyID=“SAR”>3.65</cbc:TaxAmount>
<cbc:RoundingAmount currencyID=“SAR”>28.00</cbc:RoundingAmount>
</cac:TaxTotal>
cac:Item
cbc:NameBathook</cbc:Name>
cac:ClassifiedTaxCategory
cbc:IDS</cbc:ID>
cbc:Percent15</cbc:Percent>
cac:TaxScheme
cbc:IDVAT</cbc:ID>
</cac:TaxScheme>
</cac:ClassifiedTaxCategory>
</cac:Item>
cac:Price
<cbc:PriceAmount currencyID=“SAR”>6.087</cbc:PriceAmount>
</cac:Price>
</cac:InvoiceLine>
</ns10:Invoice>