replace version info in maven2 from pom.xml to another xml file

I have several pom.xml files, contents of pom.xml is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="" xmlns:xsi="" xsi:schemaLocation="">
  <!-- default packaging -->
  <name>Colt and ADAM</name>
  <description>This package provides the ${name}</description>

 I want to pick the version from node
 and replace it to another config.xml:

 <?xml version="1.0" encoding="UTF-8"?>
<installationTaskConfiguration xmlns=""
                               xsi:schemaLocation=" InstallationTaskConfiguration.xsd">
  <registryVersion product="" releaseVersion="7" majorVersion="5" minorVersion="02"/>
  <productFeature id="tokens-active-dent"
      <version product="" releaseVersion="7" majorVersion="5" minorVersion="02" subMinorVersion="SNAPSHOT"/>
        <requiredDiskSpace id="default" size="1MB"/>
        <requiredDiskSpace id="backup" size="0MB"/>
        <requiredDiskSpace id="temporary" size="0MB"/>

 in config.xml file I want to reaplce in this format:
 <version product="" releaseVersion="7" majorVersion="5" minorVersion="02" subMinorVersion="02"/>
 can anyone give me an idea on how to copy and repace in above mentioend format?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

This should work.
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="" xmlns:pom="">
<xsl:template match="/">
	<installationTaskConfiguration xmlns=""
								   xsi:schemaLocation=" InstallationTaskConfiguration.xsd">
		<registryVersion product="">
			<xsl:attribute name="releaseVersion">
				<xsl:value-of select="substring-before(/pom:project/pom:version,'.')"/>
			<xsl:attribute name="majorVersion">
				<xsl:value-of select="substring-before(substring-after(/pom:project/pom:version,'.'),'.')"/>
			<xsl:attribute name="minorVersion">
				<xsl:value-of select="substring-before(substring-after(substring-after(/pom:project/pom:version,'.'),'.'),'.')"/>
			<xsl:attribute name="subMinorVersion">
				<xsl:value-of select="substring-after(substring-after(substring-after(/pom:project/pom:version,'.'),'.'),'.')"/>

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Did it?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.