public String writeToString ( Element elem ) { try ( StringWriter writer = new StringWriter ( ) ) { writeToWriter ( elem , writer ) ; return writer . toString ( ) ; } catch ( IOException e ) { throw new AssertionError ( "CAN'T HAPPEN: StringWriter.close() is a no-op." , e ) ; } }
Writes an NcML element to a string .