code: public void write(List<NodeTypeData> nodeTypes, OutputStream os) throws RepositoryException
     {
        OutputStreamWriter out = new OutputStreamWriter(os);
        try
        {
           for (NodeTypeData nodeType : nodeTypes)
           {
              printNamespaces(nodeType, out);
              printNodeTypeDeclaration(nodeType, out);
           }
           out.close();
        }
        catch (IOException e)
        {
           throw new RepositoryException(e.getMessage(), e);
        }
  
     }
docs: Write given list of node types to output stream.
  
  @param nodeTypes
  List of NodeTypes to write.
  @param os
  OutputStream to write to.
  @throws RepositoryException