C# XML Validator

Job ID: 36180726

Budget: $30 – $250 USD

Given a XML string and write a function to return true if the string is a valid XML string; otherwise return false. A string is a valid XML string if it satisfies the following two rules:

- Each starting element must have a corresponding ending element
- Nesting of elements within each other must be well nested, which means start first must end last. For example, <tutorial><topic>XML</topic></tutorial> is a correct way of nesting but <tutorial><topic>XML</tutorial></topic> is not

To simplify the question, we treat a pair of a opening tag and a closing tag as matched only if the strings in both tags are identical. So we don’t need to parse extra components like attributes in the XML tag. For example, we treat`<tutorial date="01/01/2000">XML</tutorial>` as not correctly closed since the string **tutorial date=”01/01/2000”** in the opening tag is different from the string **tutorial** in the closing tag

Please write a function to determine whether or not a string is a valid XML string.

Note that any class in System.XML and Regular Expression are prohibited in this question.

Your code should include the entrypoint `bool DetermineXml(string xml)`

Example 1:

Input: “<Design><Code>hello world</Code></Design>”

Output: true

Example 2:

Input: “<Design><Code>hello world</Code></Design><People>”

Output: false

Example 3:

Input: “<People><Design><Code>hello world</People></Code></Design>”

Output: false

Example 4:

Input: “<People age=”1”>hello world</People>”

Output: false

Inputs are not limited to these examples and could be anything. Please be mind that your code should be a quality that's good enough for professional developers to continue working on

If there are some cases that you don’t know if they can be considered as valid XML string or not, you can either ask us or you can define the expected outputs for those cases. But please add explanations about those cases in the document or code.

## Note

- Please add a pull request description-like document about your code and work
- Be mindful that your code should be a quality that's good enough for professional developers to continue working on

## Deliverable

- A Visual Studio C# project with your source code files (C#)
- Pull request description-like document (Markdown)

Zip everything and share it to us!