question: private void writeDomainSpec ( DomainSpec spec , Document document , Element parentElement ) { if ( spec instanceof TopDomain ) { Element topDomain = document . createElement ( "top" ) ; parentElement . appendChild ( topDomain ) ; } else if ( spec instanceof BottomDomain ) { Element bottomDomain = document . createElement ( "bottom" ) ; parentElement . appendChild ( bottomDomain ) ; } else if ( spec instanceof Category ) { Element categoryDomain = document . createElement ( "category" ) ; parentElement . appendChild ( categoryDomain ) ; Category cat = ( Category ) spec ; categoryDomain . setAttribute ( "value" , cat . getValue ( ) ) ; } else throw new RuntimeException ( "Unsupported source or sink specification type" ) ; }
target:  Writes out a domain specification object