}
Topic topic = topics[0];
XmlObject currentMsg = (XmlObject) topic.getCurrentMessage();
if ( currentMsg == null )
{
throw new NoCurrentMessageOnTopicFaultException( NAMESPACE_SET );
}
GetCurrentMessageResponseDocument responseDoc = GetCurrentMessageResponseDocument.Factory.newInstance();
GetCurrentMessageResponseDocument.GetCurrentMessageResponse response = responseDoc.addNewGetCurrentMessageResponse();
XmlBeanUtils.addChildElement( response, currentMsg );
return responseDoc;