Change variable value

I have big XML which i want to change all VERSIONNUMBER equal to 1,in existing file values of VERSIONNUMBER will be different as below now i want to change all VERSIONNUMBER values qual to 1.Please help me which will convert versionnumber values.

<SHORTCUT  OBJECTSUBTYPE ="" OBJECTTYPE  VERSIONNUMBER ="2"/>
< OBJECTTYPE REPOSITORYNAME ="" VERSIONNUMBER ="4"/>
REFERENCETYPE ="LOCAL"  VERSIONNUMBER ="1"/>
REFERENCETYPE ="LOCAL"  VERSIONNUMBER ="2"/>
<CONFIG DESCRIPTION ="Default VERSIONNUMBER ="1">

OUTPUT:

 
<SHORTCUT  OBJECTSUBTYPE ="" OBJECTTYPE  VERSIONNUMBER ="1"/>
< OBJECTTYPE REPOSITORYNAME ="" VERSIONNUMBER ="1"/>
REFERENCETYPE ="LOCAL"  VERSIONNUMBER ="1"/>
REFERENCETYPE ="LOCAL"  VERSIONNUMBER ="1"/>
<CONFIG DESCRIPTION ="Default VERSIONNUMBER ="1">

So, you just want to change

VERSIONNUMBER ="2"

to

VERSIONNUMBER ="1"

throughout the entire file?

Since no script was given, moved to dummies...

yes,it should change complete file.in file it may be any value for versionnumber but command/script should change all values to one.

Hello,

Could you please try the following code. Let's say change_number is the file which have input data.

awk -vs1="VERSIONNUMBER ="1"" '/VERSIONNUMBER =/ gsub(/VERSIONNUMBER ="2"/,s1)' change_number

Output will be as follows.

<SHORTCUT  OBJECTSUBTYPE ="" OBJECTTYPE  VERSIONNUMBER =1/>
< OBJECTTYPE REPOSITORYNAME ="" VERSIONNUMBER ="4"/>
REFERENCETYPE ="LOCAL"  VERSIONNUMBER ="1"/>
REFERENCETYPE ="LOCAL"  VERSIONNUMBER =1/>
<CONFIG DESCRIPTION ="Default VERSIONNUMBER ="1">

Thanks,
R. Singh

$ sed 's/VERSIONNUMBER[ ]*="[^"]*"/VERSIONNUMBER ="1"/g' file.xml > newfile.xml