Re: Replace all values in XML
Hi @BernatP !
I found a way to use Python script and PowerShell script for your preferred use case. Would you like to use this way?
Flow details:

I have this python script and xml file stored in a folder.

Python script:

What it is actually doing is that it gets all the Min values by xpath "//Min" and replace it to 0.
Make sure to install the "lxml" module for this to work. Use this command in your cmd (Administrator):
pip install lxml
XML data (I made an assumption of your xml as it had missing tags):
<TypeConfig>
<Keyword>1</Keyword>
<HeightALimit>
<Min>4.5</Min>
<Max>20</Max>
</HeightALimit>
<HeightB>
<Min>4</Min>
<Max>15</Max>
</HeightB>
<GLimit>
<Max>11.9</Max>
</GLimit>
<GLimitB>
<Min>0.5</Min>
<Max>5</Max>
</GLimitB>
<Subtype>
<SubtypeConfig>
<Keyword>1</Keyword>
<GLimit>
<Min>3.6</Min>
<Max>11.9</Max>
</GLimit>
<GLimitB>
<Min>0.5</Min>
<Max>5</Max>
</GLimitB>
</SubtypeConfig>
</Subtype>
</TypeConfig>
PowerShell script:

# Execute the Python script and capture its output
$output = & '%pythonExePath%' '%pythonScriptPath%'
# Output the modified XML
Write-Output $output
I stored the paths in my flow as seen in the very first pic.
Output:

<TypeConfig>
<Keyword>1</Keyword>
<HeightALimit>
<Min>0</Min>
<Max>20</Max>
</HeightALimit>
<HeightB>
<Min>0</Min>
<Max>15</Max>
</HeightB>
<GLimit>
<Max>11.9</Max>
</GLimit>
<GLimitB>
<Min>0</Min>
<Max>5</Max>
</GLimitB>
<Subtype>
<SubtypeConfig>
<Keyword>1</Keyword>
<GLimit>
<Min>0</Min>
<Max>11.9</Max>
</GLimit>
<GLimitB>
<Min>0</Min>
<Max>5</Max>
</GLimitB>
</SubtypeConfig>
</Subtype>
</TypeConfig>
Then with the help of this output, you can use any XML actions from PAD as this output acts like a XmlDocument.
If you want to re-write the file with this modified data then simply use "Write XML to file" action.

Before:

After:

This was just one XML action but you can use any of them.
Code:
SET pythonExePath TO $'''C:\\Python312\\python.exe'''
SET pythonScriptPath TO $'''C:\\Users\\Username\\testingpy.py'''
@@copilotGeneratedAction: 'False'
Scripting.RunPowershellScript.RunPowershellScript Script: $'''# Execute the Python script and capture its output
$output = & \'%pythonExePath%\' \'%pythonScriptPath%\'
# Output the modified XML
Write-Output $output''' ScriptOutput=> PowershellOutput ScriptError=> ScriptError
Text.Trim Text: PowershellOutput TrimOption: Text.TrimOption.Both TrimmedText=> PowershellOutput
XML.WriteXmlToFile.WriteToFileFormatted File: $'''C:\\Users\\Username\\testingminxml.xml''' Xml: PowershellOutput Encoding: XML.FileEncoding.DefaultEncoding Indentation: 2
XML.ExecuteXPathQuery.ExecuteXPath XmlDocument: PowershellOutput XPathQuery: $'''//Min''' XPathResults=> XPathResults
I am still trying to figure out a much simpler way using just XML actions. So I'll do some research then.
I hope this helps.