# How to call UpdateLicenseInfo and update UserData with an XML fragment

The syntax for calling UpdateLicenseInfo and update the UserData with an XML fragment is a bit tricky.

Here's an example:

{% code overflow="wrap" %}

```csharp
// This is the user data we want to set
string userData = "<Test>abc</Test><Data>mydata</Data>";

// We must escape the xml data
string escapedUserData = SecurityElement.Escape (userData);

// You can specify multiple properties in the licenseArguments tag. Here we're only setting one attribute.
// Note the UserData1 attribute value is prefixed with  \" followed by a single quote ' and then suffixed with a single quote ' followed by \".
string licenseUpdateData = String.Format ("<licenseArguments UserData1=\"'{0}'\" />", escapedUserData);

// Call the web service
license.UpdateLicenseInfo (webServiceUrl, activationKey, licenseUpdateData, out response);

// Analyze the results
ILicenseInfo li = new LicenseInfo();
string msg = string.Empty;
if (target.ParseResults(response, ref li, ref msg))
{

}
```

{% endcode %}

&#x20;

**Note:** if the value that you are setting contains a single quote, you must escape the single quote with another single quote. For example, to set a value to "Mary's Lamb", set the value to "Mary''s lamb".


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.soraco.co/docs/how-to/how-to-call-updatelicenseinfo-and-update-userdata-with-an-xml-fragment.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
