public void testXmlResourceToDomElement() throws Exception
{
final MasterConversionService service = Sapphire.service( MasterConversionService.class );
final XmlResourceStore xmlResourceStore = new XmlResourceStore();
final RootXmlResource xmlResource = new RootXmlResource( xmlResourceStore );
final XmlConversionTestElement elementOnXml = XmlConversionTestElement.TYPE.instantiate( xmlResource );
xmlResource.save();
final Element xmlElement = service.convert( xmlResource, Element.class );
assertNotNull( xmlElement );
assertSame( xmlElement, xmlResource.getXmlElement().getDomNode() );
assertSame( xmlElement, xmlResource.adapt( Element.class ) );
final XmlConversionTestElement.ListEntry childElement = elementOnXml.getList().insert();
final Element childXmlElement = service.convert( childElement.resource(), Element.class );
final XmlResource childXmlResource = (XmlResource) childElement.resource();