> For the complete documentation index, see [llms.txt](https://docs.macilib.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.macilib.org/docs/xml/functions/maci.xmlloadstrdict.md).

# maci.xmlloadstrdict

### loading a string

Loads xml string data, and returns data as a dictionary.

{% hint style="info" %}
maci.xmlloadstrdict  ->  dict\[str, Any]
{% endhint %}

*Basic Example of loading a xml string using default positional parameter*

```python
data = maci.xmlloadstrdict('<mydata><data1>one</data1></mydata>')
```

In this example, we simply load xml data from a string using the xmlloadstrdict function and pass a string as an argument to the function to load the xml data, and assign the returned data to a variable.

Access data as you normally would with a dictionary in python.

Note: All values in xml data are returned as strings.

### partner functions

Functions that are related for xml as dict

[maci.xmlloaddict](/docs/xml/functions/maci.xmlloaddict.md)  ->  Loads xml data from a file as dict\
[maci.xmldumpdict](/docs/xml/functions/maci.xmldumpdict.md)  ->  Dumps xml data to a file from dict\
[maci.xmldumpstrdict](/docs/xml/functions/maci.xmldumpstrdict.md)  ->  Dumps xml data to a string from dict

### parameters & arguments

Describes all parameter functionality and accepted data types

<details>

<summary>xml_str_data:  str</summary>

First and only required positional argument. Accepts strings

Use this parameter to pass in your xml formatted string data

</details>

*This function uses the xmltodict library installed as a dependency from pypi for its underlying functionality. For more information on xmltodict, visit:* [*https://pypi.org/project/xmltodict/*](https://pypi.org/project/xmltodict/)

**Security awareness**: It is important to evaluate handling XML data carefully as there are known vulnerabilities in dealing with XML data. Please refer to the [official python documentation](https://docs.python.org/3/library/xml.etree.elementtree.html).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.macilib.org/docs/xml/functions/maci.xmlloadstrdict.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
