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

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

Suppose, we have the following group spec:
[source,xml]
----
<feature-group-spec name="group1" xmlns="urn:jboss:galleon: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 configuration:
[source,xml]
----
<config name="main">
  <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 `include` elements are picking the features that need to be included into the configuration.

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

NOTE: `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 name="main">
  <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>
----
