Hi!
Maybe this can help you?
https://forum.dynamobim.com/t/how-do-you-create-an-xml-file-using-a-python-script/3859/6