Anyone knows how to save a JavaFX scene into FXML file that can be loaded by the JavaFX FXMLLoader?
The SceneBuilder allows to do it, but if I build the scene manually,
If you mean build a fxml file from a running screen built in Java, the short answer is that you can't.
The fxmlLoader is designed to work only to load files, it references the class XMLInputFactory but not the XMLOutputFactory.
If you would like to do it by yourself, it is not only rewrite the classes read by the FXMLLoader, because there is a lot of reflection (java.lang.reflect) in that class.
So the long answer could be: you can do it by yourself using a lot of reflection and writing dynamic tags from class names, but there will be no guarantee that your fxml gives the expected results.