refactoring.
fix bug in ParseXml function.

Signed-off-by: Ken Tseng <vul3yo6@hotmail.com>