Hi Bahaa,
Did you declare domain as attribute in your XML schema? If not than you need to add this in your XML schema.
Please see the below XML schema that I used to generate the XML that you wanted.
XML Schema:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="Credential">
<xs:complexType>
<xs:sequence>
<xs:element name="Identity" minOccurs="0" type="xs:long"/>
<xs:element name="SharedSecret" minOccurs="0" type="xs:string"/>
</xs:sequence>
<!-- This is where to declare attributes: -->
<xs:attribute name="domain" type="xs:long"/>
</xs:complexType>
</xs:element>
</xs:schema>
This is the test microflow that I used to create credential object using Export to XML action
Export Mapping and XML Schema:
Result Output:
Hope this helps!