@ Deprecated protected static byte [ ] nodeToByte ( Node node ) throws PolicyIndexException { ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; Writer output = new OutputStreamWriter ( out , Charset . forName ( "UTF-8" ) ) ; try { SunXmlSerializers . writePrettyPrintWithDecl ( node , output ) ; output . close ( ) ; } catch ( IOException e ) { throw new PolicyIndexException ( "Failed to serialise node " + e . getMessage ( ) , e ) ; } return out . toByteArray ( ) ; }
get XML document supplied as w3c dom Node as bytes