private RouteAdvertisement getRouteAdvertisement(Message msg) {
RouteAdvertisement routeAdv = null;
MessageElement routeElement = msg.getMessageElement(ReplicationState.NAMESPACE, ReplicationState.ROUTEADV);
if (routeElement != null) {
try {
XMLDocument asDoc = (XMLDocument) StructuredDocumentFactory.newStructuredDocument(
routeElement.getMimeType(), routeElement.getStream());
routeAdv = (RouteAdvertisement)
AdvertisementFactory.newAdvertisement(asDoc);
} catch (IOException io) {
io.printStackTrace();