Convert a tldraw snapshot to hierarchical XML
Converts a tldraw StoreSnapshot into an XML document that encodes the diagram hierarchy. Parent-child relationships are derived from tldraw’s native parentId system: shapes inside a data-shape or frame container appear as nested child elements in the XML.
Every non-arrow element also carries its geometry (x/y parent-local coordinates plus w/h) so spatially-laid-out diagrams (e.g. flowcharts) keep their positions, not just nested ones.
Shape mapping:
data-shape→<entity id name type x y w h>(entity-backed node)frame→<group name x y w h>- geo shapes →
<shape type label x y w h> - arrows → omitted from tree, captured in
<connections>with their own label (e.g. a flowchartYes/Nobranch)
The snapshot is the object returned by editor.store.getStoreSnapshot() or by the /convert/drawio-to-tldraw endpoint.
Authorizations
Headers
Workspace identifier
Body
Response
Hierarchical XML string representing the diagram structure