<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.6</version>
<configuration>
<check>
<haltOnFailure>false</haltOnFailure>
<totalLineRate>85</totalLineRate>
</check>
<formats>
<format>html</format>
<format>xml</format>
</formats>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>cobertura</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>3.0.0-M4</version>
<configuration>
<formats>
<format>xml</format>
</formats>
</configuration>
</plugin>
need to check whether the "format" tag with value "xml" is given in pom file for cobertura plugin. tried to parse the xml file in bash
temp= $(grep -n -oP '(?<=<format>)[^<]+' pom.xml)
this returns all the value with tag including html, xml. How to parse this file and validate?