# How to use an XML Configuration

**URL:** <https://faq.inetsoftware.de/t/how-to-use-an-xml-configuration/60>\
**Category:** API\
**Tags:** version4, version3\
**Created:** [June 8, 2016, 5:42am UTC](https://faq.inetsoftware.de/t/how-to-use-an-xml-configuration/60 "2016-06-08T05:42:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RichardRoedel](https://faq.inetsoftware.de/user_avatar/faq.inetsoftware.de/richardroedel/32/27_2.png) [@RichardRoedel](https://faq.inetsoftware.de/u/RichardRoedel)\
**Post date:** [June 8, 2016, 5:42am UTC](https://faq.inetsoftware.de/t/how-to-use-an-xml-configuration/60/1 "2016-06-08T05:42:32Z")

</div>

To load an XML configuration file, please use the class **XMLConfiguration**.  
This class requires an XML files as a parameter

```
IConfiguration configuration = null;
try {
    configuration = new XMLConfiguration( <XML config file> );
} catch( InvalidPropertiesFormatException e ) {
    e.printStackTrace();
}

```

That configuration can now be used as usual

```
new PDFComparer()
            .setConfiguration( configuration )
            .addPresenter( new ReportPDFPresenter(false, true, <file1>.getParentFile()) )
            .compare( <file1>, <file2> );

```

[View full sourcecode](https://github.com/i-net-software/pdfc-samples/blob/master/src/main/java/configuration/UseXMLConfiguration.java)
