Reading and Writing xml using DOm Parser