public function formatXmlString($xmlString)
    {
        if(true === $this->isXml($xmlString))
        {
            $dom = new \DOMDocument;
            $dom->preserveWhiteSpace = false;
            $dom->loadXML($xmlString);
            $dom->formatOutput = true;

            return $dom->saveXml();
        }
        else
        {
            throw new InvalidArgumentException('Incorrect XML string');
        }
    }