* @param model the model to marshall
* @return the xml
*/
String outputModel(ModelNode model) throws Exception {
StringConfigurationPersister persister = new StringConfigurationPersister(Collections.<ModelNode>emptyList(), testParser, true);
// Use ProcessType.HOST_CONTROLLER for this ExtensionRegistry so we don't need to provide
// a PathManager via the ExtensionContext. All we need the Extension to do here is register the xml writers
ExtensionRegistry outputExtensionRegistry = new ExtensionRegistry(ProcessType.HOST_CONTROLLER, new RunningModeControl(RunningMode.NORMAL));
outputExtensionRegistry.setSubsystemParentResourceRegistrations(MOCK_RESOURCE_REG, MOCK_RESOURCE_REG);
outputExtensionRegistry.setWriterRegistry(persister);
Extension extension = mainExtension.getClass().newInstance();
extension.initialize(outputExtensionRegistry.getExtensionContext("Test", false));
ConfigurationPersister.PersistenceResource resource = persister.store(model, Collections.<PathAddress>emptySet());
resource.commit();
return persister.getMarshalled();
}