/// <summary>
 /// Generates an XElement storing the information for the method response.
 /// </summary>
 /// <returns>The generated XElement.</returns>
 public XElement GenerateResponseXml()
 {
     return(new XElement(XName.Get(XmlRpcElements.MethodResponseElement),
                         HadFault
             ? new XElement(XName.Get(XmlRpcElements.FaultElement), fault.GenerateXml())
             : new XElement(XName.Get(XmlRpcElements.ParamsElement),
                            new XElement(XName.Get(XmlRpcElements.ParamElement),
                                         returned.GenerateXml()))));
 }