Using the sample code from here (Working with PDF File Metadata | C#|Aspose.PDF for .NET) produces the following XML:
<rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/">
<xmp:CreatorTool>Microsoft® Word for Microsoft 365</xmp:CreatorTool>
<xmp:ModifyDate>2022-09-12T02:23:42.6+03:00</xmp:ModifyDate>
<xmp:CreateDate>2022-09-12T02:23:42.6+03:00</xmp:CreateDate>
<xmp:Nickname>Nickname</xmp:Nickname>
<xmp:CustomProperty>Custom Value</xmp:CustomProperty>
</rdf:Description>
Looking at old samples using other XMP Toolkit or other tools I see that instead of elements the single values are serialized as attributes:
<rdf:Description rdf:about=""
xmlns:xmp="http://ns.adobe.com/xap/1.0/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:pdf="http://ns.adobe.com/pdf/1.3/"
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
xmp:CreateDate="2013-06-11T10:27:50-04:00"
xmp:CreatorTool="Adobe Graphics Manager"
xmp:ModifyDate="2013-09-11T16:49:11-04:00"
pdf:Producer="Acrobat Distiller 9.5.3 (Macintosh)"
xmpMM:DocumentID="uuid:ff8aaf38-fcb3-da41-8772-366fcee062bf"
xmpMM:InstanceID="uuid:ee4d40a2-8257-1d42-accf-84f42acfea85">
How can I achieve this with Aspose.PDF Library - thanks.