LocalContainer container = ...;
StandaloneLocalConfiguration configuration = (StandaloneLocalConfiguration) getLocalContainer().getConfiguration();
XmlReplacement defaultHost = new XmlReplacement();
defaultHost.setFile("conf/server.xml");
defaultHost.setXpathExpression("//Server/Engine");
defaultHost.setAttributeName("defaultHost");
defaultHost.setValue("myhost");
configuration.addXmlReplacement(defaultHost);