import javax.xml.parsers.*; 
import org.w3c.dom.*; 


// Read LwsConfig.xml

document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse( new File(configfile) ); 

// Get infos of root container artfifact

e = document.getElementsByTagName("RootContainer").item(0).getElementsByTagName("SRL").item(0);
attributlist = e.getElementsByTagName("Attribute");  
nAttributes  = attributlist.getLength();

// Get LWS-Catalog

catalog = lwsapi.getLwsCatalog(lwspath);

// Get root artifact of catalog

root = catalog.getRootArtifact();

// Set attributes

for( j = 0; j < nAttributes; j++ )
{
    name = attributlist.item(j).getElementsByTagName("AttributeName").item(0).getTextContent();
    value = attributlist.item(j).getElementsByTagName("AttributeValue").item(0).getTextContent();
    root.setAttribute(name, value);
}


