generateRBXMX() function generates RBXMX XML model file content from a compiled StyleSheetIR. The output can be saved as a .rbxmx file and imported into Roblox Studio.
Signature
Parameters
The compiled intermediate representation from
compile(). See types for the full structureReturns
Generated RBXMX XML content as a string. The output contains a
StyleSheet instance with child StyleRule instancesExample
Output structure
The generated RBXMX follows this structure:Limitations
- Properties as comments — StyleRule properties are written as XML comments instead of encoded RBXMX property values. This means you cannot directly use the imported model in-game without manual configuration
- No property encoding — Token attributes and StyleRule properties require manual Roblox Studio setup
- Experimental status — This format may change in future versions
Use cases
Despite the limitations, RBXMX output is useful for:- Visual inspection — View the structure of the compiled StyleSheet in Roblox Studio
- Manual editing — Create a base structure that you can configure manually
- Debugging — Compare the generated structure with expected output
XML escaping
The following characters in names and values are automatically escaped:&→&<→<>→>"→"
.w-\[22px\] or special characters in token names are safely encoded.
Related
- compile() — Compile CSS to IR
- generateLuau() — Generate Luau code (recommended)
- Types reference — Full type definitions