U child = parent.createChild(childElement);
Dom unwrappedChild = Dom.unwrap(child);
boolean writeDefaultElementsToXml = Boolean.parseBoolean(System.getProperty("writeDefaultElementsToXml", "true"));
if (!writeDefaultElementsToXml) {
//Do not write default snippets to the domain.xml
unwrappedChild.skipFromXml();
}
unwrappedChild.addDefaultChildren();
configModularityUtils.getExtensions(parent).add(child);
return child;