> For the complete documentation index, see [llms.txt](https://docs.rainbird.ai/rainbird/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rainbird.ai/rainbird/knowledge-modelling/modelling-features/rblang-reference/xml-structure-and-namespaces.md).

# XML structure and namespaces

Every RBlang document starts with the XML declaration and the root knowledge base element.

```xml
<?xml version="1.0" encoding="utf-8"?>
<rbl:kb xmlns:rbl="http://rbl.io/schema/RBLang">
    <!-- knowledge base content -->
</rbl:kb>
```

### Required structure

* `<?xml version="1.0" encoding="utf-8"?>`
* `<rbl:kb>` as the root element
* `xmlns:rbl="http://rbl.io/schema/RBLang"` on the root element

Use UTF-8 encoding.

{% hint style="warning" %}
The `xmlns:rbl` namespace is required.
{% endhint %}

### Recommended definition order

Define elements in this order:

1. Concepts
2. Relationships
3. Concept instances for `string` concepts
4. Relationship instances and rules

### Core elements

RBlang uses these core elements:

* `<concept>` for concept definitions
* `<rel>` for relationship definitions
* `<concinst>` for string concept instances
* `<relinst>` for facts and rules
* `<condition>` for rule conditions

### Skeleton template

```xml
<?xml version="1.0" encoding="utf-8"?>
<rbl:kb xmlns:rbl="http://rbl.io/schema/RBLang">
    <concept name="Person" type="string"/>
    <concept name="Age" type="number"/>

    <rel name="has age" subject="Person" object="Age"/>

    <concinst name="John Smith" type="Person"/>
    <relinst type="has age" subject="John Smith" object="25"/>
</rbl:kb>
```

### Type naming in RBlang

RBlang uses the type name `truth` for boolean concepts.

```xml
<concept name="Is Eligible" type="truth"/>
```


---

# 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.rainbird.ai/rainbird/knowledge-modelling/modelling-features/rblang-reference/xml-structure-and-namespaces.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.
