I\'m using DatacontractSerializer
to serialize my domainModel into a xml file.
I\'m getting output like below.
It looks like DataContractSerializer
doesn't give much control over prefixes. The answer to XML Serialization and namespace prefixes suggests using XmlSerializer
if you want to control the namespace prefix.
Your question wasn't clear as to whether you wanted to entirely remove the namespace prefixes for your domain model. Your sample above has several namespace prefixes: d1p1, d2p1, d4p1. Changing namespace for XML file in XSL Translation provides some guidance on prefix renaming using XSLT.