我有 423 个 xml 文件来训练我的深度学习模型。我搜索了一些 python 代码和 xslt 等,但我不知道该怎么做。这是一个文件的示例:
<?xml version="1.0"?>
-<case>
<number>2</number>
<age>49</age>
<sex>F</sex>
<composition>solid</composition>
<echogenicity>hyperechogenicity</echogenicity>
<margins>well defined</margins>
<calcifications>non</calcifications>
<tirads>2</tirads>
<reportbacaf/>
<reporteco/>
-<mark>
<image>1</image>
<svg>[{"points": [{"x": 250,"y": 72},{"x": 226,"y": 82},{"x": 216,"y": 90},{"x": 204,"y": 94},{"x": 190,"y": 98},{"x": 181,"y": 103},{"x": 172,"y": 109},{"x": 165,"y": 121},{"x": 161,"y": 131},{"x": 159,"y": 142},{"x": 162,"y": 170},{"x": 164,"y": 185},{"x": 171,"y": 203},{"x": 176,"y": 210},{"x": 185,"y": 214},{"x": 191,"y": 218},{"x": 211,"y": 228},{"x": 212,"y": 230},{"x": 235,"y": 239},{"x": 243,"y": 242},{"x": 255,"y": 244},{"x": 263,"y": 245},{"x": 285,{"x": 298,{"x": 330,"y": 233},{"x": 352,"y": 217},{"x": 367,"y": 201},{"x": 373,"y": 194},{"x": 379,"y": 173},{"x": 382,"y": 163},{"x": 383,"y": 143},"y": 136},"y": 127},"y": 122},{"x": 374,"y": 117},{"x": 365,{"x": 360,"y": 101},{"x": 358,"y": 95},"y": 88},{"x": 346,"y": 85},{"x": 333,"y": 81},{"x": 327,"y": 78},{"x": 319,"y": 73},{"x": 314,{"x": 304,"y": 70},{"x": 281,"y": 69},{"x": 258,"y": 71},{"x": 254,{"x": 248,"y": 72}],"annotation": {},"regionType": "freehand"}]</svg>
</mark>
</case>
我需要解析(包括)数字和 tirads 之间的信息。如何使用 Python 将这些转换为单个文件?