Save AIS_Dimension derived objects to a file

Hi guys!

I'm new to OCCT and need some help.

I import a complex model from a IGES or STEP file. This works so far.

The goal is: the user makes some lenght dimensions on the model and than save the hole thing to a file.

I know there is the XDE Tool and I'm able to save simple Objects (boxes etc.) to a .cbf and .igs files.
I would like to save the comple model with the user-added "AIS_LengthDimension" object made of 2 vertex that were clicked on this complex model. I saw on the XDE manual that it is possible to handle with "Geometric Dimensions & Tolerances (GD&T)" Data but I coulnd't figur out how to connect a "AIS_Dimension" with "XCAFDoc_DimTolTool" or is there a other way to save the "AIS_Dimension" Information within the model.

I attached a JPEG to this post to show what I mean.

Could you guy help me? Thanks!