'Use Blockly to process XML file

Say I have an XML file, like this:

<?xml version="1.0"?>
<Catalog>
  <Book Title="First Book" Year="2021"/>
  <Book Title="Second Book" Year="1950"/>
  <Book Title="Third Book" Year="2020"/>
</Catalog>

How can I set up blockly to be able to use this as input, loop the child elements and add a new attribute IsOld="1" for books with year before 2000?

On the output I'd like to create a new, modified XML file.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source