###### Picking features from a group by IDs

[[fg-include-features-by-ids]]When a feature group is included into another group or a config, by default all the features it contains are included but it is also possible to pick which ones exactly should be included.


Suppose, we have the following group spec:
[source,xml]
----
<feature-group-spec name="group1" xmlns="urn:wildfly:pm-feature-group:1.0">

  <feature spec="feature1">
    <param name="id" value="a1"/>
  </feature>
  <feature spec="feature1">
    <param name="id" value="a2"/>
  </feature>
  <feature spec="feature2">
    <param name="id" value="b1"/>
  </feature>
  <feature spec="feature2">
    <param name="id" value="b2"/>
  </feature>


</feature-group-spec>
----

Here is how *feature1:id=a1* and *feature2:id=b1* can be picked into the config:
[source,xml]
----
<config>
  <feature-group name="group1" inherit-features="false">
    <include feature-id="feature1:id=a1"/>
    <include feature-id="feature2:id=b1"/>
  </feature-group>
</config>
----

NOTE: `inherit-features` attribute indicates whether the whole feature set of the group should be included into the config or not. If this attribute is not specified, its value is assumed to be true.

Then the `include` elements are picking the features that need to be included by their IDs.

The config will include *feature1:id=a1* and *feature2:id=b1*.

The `include` elements can also be used to pick features from the excluded feature specs. The config below is equivalent to the config above.

[source,xml]
----
<config>
  <feature-group name="group1" inherit-features="true">
    <exclude spec="feature1"/>
    <exclude spec="feature2"/>
    <include feature-id="feature1:id=a1"/>
    <include feature-id="feature2:id=b1"/>
  </feature-group>
</config>
----
