Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
60 lines (46 sloc) 1.92 KB


Please use: Dart XML

No further updates or patches will be accepted, but the source code will remain available.

The new library will utilize the same package on pub as this one, but will begin from version 2.0.0.

Thanks to everyone for your support on this project!

Dart Xml

Dart Xml is a lightweight library for parsing and emitting xml.

What "Lightweight" Means

Many programmatic scenarios concerning XML deal with serialization and deserialization of data, usually for transmission between services). The querying of said data in object form is also important. Typically these data are XML fragments and not fully formed XML documents. Even so, the library is able to deal with fully formed XML documents.

Dart Developers who require more robust XML handling are encouraged to fork the project and expand as needed. Pull requests will certainly be welcomed.

Getting Started

See the "" file in the doc/ directory of the project.

And example.dart file in the example/ directory.


// Returns a strongly-typed XmlNode tree
XmlElement myXmlTree = XML.parse(myXmlString);


// Returns a stringified xml document from a given XmlNode tree
String myXmlString = XML.stringify(myXmlNode);

// or...
String myXmlString = myXmlNode.toString();


  • Standard well-formed XML
  • Comment nodes
  • CDATA nodes
  • Text nodes
  • Namespace declarations and usage
  • Processing Instruction (PI) nodes
  • Querying of XML nodes by tagName, attribute(s), or XmlNodeType (combinators soon hopefully)
  • Top-Level Declarations


  • Doesn't enforce DTD
  • Doesn't enforce any local schema declarations


Apache 2.0