A flowchart is hierarchically structured and XML likewise is hierarchically structured. So what are the difficulties here? I don't know, but you can feel free to add some via a comment. Take an if statement for instance, it consists of a condition, a consequence and an alternative.
So to build this into XML this here seems a valid approach:
<flowchart>
<if condition="i<1">
<consequence>
<consequence>
<alternative>
</alternative>
</if>
</flowchart>
If on the other hand the code inside the condition of the if-statement would become complexer you might make a sepearate tag out of the attribute "condition" like so:
<flowchart>
<if>
<condition>
</condition>
<consequence>
<consequence>
<alternative>
</alternative>
</if>
</flowchart>
[Modification: Inspired by
CPallini's[
^]
Solution 1[
^]
]
<flowchart>
<sequence id="initialization">
<block id="block1" followRef="block2">
</block>
<block id="block2" followRef="block1">
</block>
</sequence>
</flowchart>
[End Modification]
The followRef attributes link from one block to another and in this case I even formed a cycle. (Just for instructional purposes though and not so meaningful in this context)
Regards,
— Manfred