// Create connection to XML library.
XmlLibraryConnection connection = new XmlLibraryConnection("path to the library");
// Path to the created connection file.
string path = connection.ConnectionPath;
// Using this connection you can connect project to the library.
Project project = ...
project.ConnectToLibrary(connection):
// If the library is password protected, you must specify the password:
// 1.) When creating a connection (only once):
connection = new XmlLibraryConnection("path to the library", "password");
project.ConnectToLibrary(connection);
// 2.) When connecting to the library (always when connecting to the library):
connection = new XmlLibraryConnection("path to the library");
project.ConnectToLibrary(connection, "password");