Question: My Web Service returns xml.In OnInvoke method I have xml data it contains time and some text that are to be shown at given times on popup.

Answer: 
As per Unsupported APIs of Background Agents, you can not use MessageBox from Schedule Agent.
<http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202962(v=vs.105).aspx>

The best solution to display a message from Schedule Agent is Toast Notification.
You can make a message box according to your own design using user control. Then make an object of that control on your class where you want to use it. Make a popoup object and set control object as the child of pop up object.

```
UserControlName objectname = new UserControlName ();

PopUP popup = new PopUP();
popup.Child = objectname ;
popup.IsOpen = true;

```

I think it will help you.
<http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.popup.child(v=vs.95).aspx>

<http://www.geekchamp.com/tips/how-to-get-user-input-from-a-popup-in-windows-phone>