ansible xml; setting child element based on node attribute value

Hi,

i have multiple xml node which multiple child elements. each node differs from other based on the value of its attribute.

i want to set the value of child elements based on the value of the parent node’s attribute. when i try to select the node based on the attribute value and then its children value, it says that the two operations are mutually exclusive.

https://pastebin.com/6jv7pgGN

do i need to break the operation into two separate operations? is it possible to accomplish this in a single xml task?

Regards
Ali

i was able to figure out this one by using xpath expression, but a new problem is that when you do set_children on any one of its child, it wipes out all the other child elements, which seems to be the behavior by design, which seems to be a very strange behavior compared to all other tools that do xml manipulation.

is there a way that i can set the value of a child elements and preserve all my other child nodes?

Regards
Ali