xml module don't keep the xml nested child structure in the result

Hi,
I’m trying to use the xml module to find a xml block.
The xpath find the block, but all nested child structure is removed, I.E all data is at same level after.
Has anyone any ideas what is missing?
Wrong module to use?

tasks:

  • name: manage xml block
    xml:
    path: “output/{{ inventory_hostname }}_get_config.xml”
    xpath: /root/groups[name=“test”]//*
    content: text
    register: test

  • name: Print result xml
    debug:
    msg: "{{ test.matches}} "

Hard to say without any actual xml content

Hi,
Here comes an example:

test test any any any test2 0 0 254 1 128

The output is :

“matches”: [
{
“name”: “test”
},
{
“security”: null
},
{
“policies”: null
},
{
“global”: null
},
{
“policy”: null
},
{
“name”: “test”



söndag 12 september 2021 kl. 16:11:01 UTC+2 skrev dick....@geant.org: