I wish to parse configuration files like apache2.conf, which appears like this:

<Group group1>
   param1 1

   <SomeGroup group3>
      param3 3
   </SomeGroup>
</Group>

<Group group2>
   param2 2
</Group>

Regexp:

re.findall(r'\</?[^\>]+\>([\s\S]+)\<//?[^\>]+\>', text, re.MULTILINE)

basically use lazy regexp, it cuts such as this:

<Group group1>
   param1 1

   <SomeGroup group3>
      param3 3
   </SomeGroup>

Basically use greedy regexp, it cuts all of the text. So, what's the right way to parse it? Or perhaps is there any libraries?

There's no method of doing this with regexp alone. The regexp engine doesn't have condition, to help you only parse quite simple input. See for other available choices: Any python libs for parsing apache config files?