diff --git a/src/Gui/SoFCDB.cpp b/src/Gui/SoFCDB.cpp
index 5fe4b7762b..5b3f057524 100644
--- a/src/Gui/SoFCDB.cpp
+++ b/src/Gui/SoFCDB.cpp
@@ -643,7 +643,6 @@ bool Gui::SoFCDB::writeToX3DOM(SoNode* node, std::string& buffer)
<< " \n"
<< " \n"
<< " \n";
- out << x3d;
auto onclick = [&out](const char* text) {
out << " \n";
@@ -656,6 +655,8 @@ bool Gui::SoFCDB::writeToX3DOM(SoNode* node, std::string& buffer)
onclick("Top");
onclick("Bottom");
+ out << x3d;
+
out << "