How to validate xml file in actionscrip3.0?

<note>
<to>ahmad</to>
<from>jhon
<body>hello how are you!!!</body>
</note>

above is my xml file which have no ending tag of from tag. which id an error.
i want an actionscript code to check if there is a broken tag then fix it automaticaly . and my code displays the correct xml.

anyone who can help me???

Thanks

Regards
Ahmad