Is it possible to update the node attributes of an xml using simplexml? example:-my program is actually a quiz editor for teacher, as a teacher, i want to edit a specific question attributes. ie
<Quiz>
<topic text="Preparation for Exam">
<subtopic text="Math">
<question text="1 + 1 = ?">
<answer num="A" Text="1" />
<answer num="B" Text="2" />
<answer num="C" Text="3" />
<answer num="D" Text="4" />
</question>
<question text="4 * 4 = ?" >
<answer num="A" Text="12" />
<answer num="B" Text="14" />
<answer num="C" Text="16" />
<answer num="D" Text="18" />
</question>
</subtopic>
</topic>
</Quiz>
is it possible? though i have tried a lot of ways ie by deleting the previous node and then inserting the edited one. but this trick only works for last node... for other nodes it just do swapping