Option Explicit
Public DocXML
Dim CustomUI As XmlElement, ribbon As XmlElement, tabs As XmlElement, XtaB As XmlElement, group As XmlElement, button As XmlElement
Sub test()
Dim elem As XmlElement
Set DocXML = New XmlElement
Set CustomUI = DocXML.createElement("customUI")
DocXML.AppendChild CustomUI
Set ribbon = DocXML.createElement("ribbon")
CustomUI.AppendChild ribbon
Set tabs = DocXML.createElement("tabs")
ribbon.AppendChild tabs
Set XtaB = DocXML.createElement("tab")
' XtaB.ID = "tab_" & tabs.childcount + 1
' XtaB.label = "mon onglet"
tabs.AppendChild XtaB, "tab_" & tabs.childcount + 1, "mon onglet"
Set group = DocXML.createElement("group")
' group.ID = "group_" & XtaB.childcount + 1
' group.label = "mon onglet"
XtaB.AppendChild group, "group_" & XtaB.childcount + 1, "mon onglet"
Set button = DocXML.createElement("group")
' button.ID = "button_" & group.childcount + 1
' button.label = "mon bouton"
group.AppendChild button, "button_" & group.childcount + 1, "mon bouton"
Set button = DocXML.createElement("group")
' button.ID = "button_" & group.childcount + 1
' button.label = "mon bouton 2"
group.AppendChild button, "button_" & group.childcount + 1, "mon bouton 2"
Set elem = group.ChildNodes(1)
MsgBox elem.ID
MsgBox elem.parentX.ID
Dim D As XmlElement
Set D = DocXML.getElementById(Cherche:="tab_1")
MsgBox D.ID
MsgBox D.parentX.ID
End Sub